Andrei Alexandrescu wrote:

You can't call delete against a struct object, so the above wouldn't compile. What may solve your problem is calling GC.hasNoPointers against the block of memory in which hugeDataStructure lives. But before that... isn't the current GC non-conservative for heap-allocated objects? I thought it's only conservative for stack objects.

It's conservative for everything, unless you count marking an entire block as "has pointers" non-conservative. The GC currently doesn't know where in a block the pointers are, so it treats all such labeled blocks conservatively.

Reply via email to