-
Notifications
You must be signed in to change notification settings - Fork 5.3k
[mono] Base ALC unloadability functionality #39301
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Tagging subscribers to this area: @CoffeeFlux |
lambdageek
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd err on the side of being paranoid about locking, for now, during unloading.
Overall this seems like it will work, but I think for generic instance objects we'll need a GenericRefTracker managed object that references the set of ReferenceTrackers the instance could come from.
src/mono/mono/metadata/sgen-mono.c
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You will need to pass some kind of user_data to handle_ref_trackers_from_frame so that it call call (GcScanFunc)ctx.ops->copy_or_mark_object (see how mono_handle_stack_scan does it, below) during the precise pass.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's supposed to scan the obj->vtable->klass->image->alc->ref_tracker gc handle for a non-generic object and
for a generic instance it's each_ref_tracker_of_image_set (((MonoClassGenericInst*)obj->vtable->klass)->generic_class->owner) something like that?
So if we put something in the vtable directly, for a generic instance we'd need some kind of GenericRefTracker that points at an array of regular ref trackers, right?
src/mono/netcore/System.Private.CoreLib/src/ILLink/System.Private.CoreLib.xml
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does the _code suffix mean here ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just that it's code memory, though maybe that's unnecessary. I wasn't sure on the nomenclature for a bunch of this.
Create RefTracker, MemoryManager; move domain memory into MemoryManager
9bd96ea to
53fcd07
Compare
|
Would be nice to split parts of this into smaller PRs, its huge. |
|
Yeah, I'll push the next round of changes and then start chunking it up into separate PRs. Some of the commits should already be reasonably-sized at least. |
|
excited work,why not this pr merged first? |
|
I'm currently on vacation, so I wouldn't expect this PR to move a whole lot right now :) |
|
when can this pr be merged? |
|
? |
|
I'll be working on this more next week. It will not be part of the .NET 5 release; that has already branched without this PR, and master is now .NET 6. |
|
OK, thank for your reply, if this feature work, we will begin with .net6. |
Various functionality is behind build defines due to both stability and performance concerns.
Remaining work for this PR:
mono_memory_manager_from_methodRemaining long-term work:
keepalivefield with RefTracker for reflection types