Uh oh!
There was an error while loading. Please reload this page.
Store pinned static fields in the Pinned Object Heap. - #89895
Conversation
Now that we don't pin `FixedAddressValueType` fields, this mechanism is unused.
We remove the check that blocked it, enable a test and update a design document.
ghost
commented
Aug 2, 2023
Tagging subscribers to this area: @vitek-karas, @agocke, @VSadov Issue DetailsThis PR allocates fields marked with Because we don't use a pinned handle to pin the fields anymore, the object is not permanently held in memory, which enables unloadability for assemblies with pinned static fields. All we have to do is remove the check that blocked these assemblies, and unmark the relevant unit test as incompatible with unloadability. I also removed a now-unused tracking mechanism for thread-static pinned fields. Fixes #66043
|
Uh oh!
There was an error while loading. Please reload this page.
janvorli
commented
Aug 3, 2023
@teo-tsirpanis you'll also need to remove the library negative test for the FixedAddressValueType attribute and unloadability - it is causing the CI failures. |
Uh oh!
There was an error while loading. Please reload this page.
MichalPetryka
commented
Aug 3, 2023
Worth noting is that this will unload the assembly when the user uses |
86c75a7 to
ba19e2cCompareba19e2c to
921f45fComparemangod9
commented
Sep 18, 2023
@teo-tsirpanis, could you please rebase the PR and then we could run the CI again to get it merged? Thanks |
teo-tsirpanis
commented
Sep 21, 2023
@mangod9 done. CI is green. |
This PR allocates fields marked with
[FixedAddressValueType]to the Pinned Object Heap. We introduce a new overload ofAllocateObjectthat accepts aGC_ALLOC_FLAGS, and when allocating the static fields we passGC_ALLOC_PINNED_OBJECT_HEAPif the field has that attribute.Because we don't use a pinned handle to pin the fields anymore, the object is not permanently held in memory, which enables unloadability for assemblies with pinned static fields. All we have to do is remove the check that blocked these assemblies, and unmark the relevant unit test as incompatible with unloadability. I also removed a now-unused tracking mechanism for thread-static pinned fields.
Fixes#66043