Destroy all generic instances when module is unloaded#286
Merged
alexey-zakharov merged 5 commits intounity-mainfrom Apr 4, 2025
Merged
Destroy all generic instances when module is unloaded#286alexey-zakharov merged 5 commits intounity-mainfrom
alexey-zakharov merged 5 commits intounity-mainfrom
Conversation
Collaborator
|
Is this a change that upstream would be interested in? |
Author
I believe so, I'll make an issue to discuss it |
joncham
approved these changes
Mar 28, 2025
Member
joncham
left a comment
There was a problem hiding this comment.
Approving, but really deferring to upstream issue discussion and resolution.
Author
|
created an upstream issue with a reproproject - dotnet#114068 |
e4d3ed3 to
f1969bc
Compare
Co-authored-by: Noah Falk <[email protected]>
(cherry picked from commit 97ee0de)
Co-authored-by: Jan Kotas <[email protected]> (cherry picked from commit 20233ec)
(cherry picked from commit da7ddd3)
f1969bc to
dd1a231
Compare
Author
|
@UnityAlex @joncham the PR should now match dotnet#114107 which is merged to upstream |
UnityAlex
approved these changes
Apr 4, 2025
Collaborator
UnityAlex
left a comment
There was a problem hiding this comment.
Thanks for upstreaming this!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ClassUnloadStartedandClassUnloadFinishedprofiler api callbacks are not called for generic instances which are allocated under a different loader allocator. That:Notifylogic which is done at class loading time - https://github.com/dotnet/runtime/blob/main/src/coreclr/vm/clsload.cpp#L2617The suggested change makes
Destructto be called for all classes.There is a potential sideeffect as
EEClass:Destructwhen the class is a delegate type - https://github.com/dotnet/runtime/blob/main/src/coreclr/vm/class.cpp#L124, but if I read the code correctly it should decrement a reference that was added when a delegate instance was created.