-
-
Notifications
You must be signed in to change notification settings - Fork 753
Description
In commit 67ef621, I probably introduced a regression which causes indirections in Heap Payloads (classes and Elements bigger than a specific size) to be invisible to the GC by allocating an object on the heap as ubyte[T.sizeof], since the GC can assume from the type that the region contains no pointers and can disable scanning for it.
Here is my investigation on whether the GC actually does that from #10929 , which also attempts to fix this bug.
I think if the GC is configured to be "Precise", it will dynamically mark regions as pointers or not, depending on type typeinfo. I.e. will eventually go here and mark a ubyte array as not having pointers.
This then answers my question. Since the variant constructor marks the store as a pointer, and the GC marks the stored types as pointer, it should check it recursively without caring what type the code sees, only the type at malloc matters for the payload. Thus, the changes in this PR are neccesary.