On Mon, 09 Apr 2012 13:39:10 -0400, Alex Rønne Petersen
<[email protected]> wrote:
In MCI, I can't provide finalization support when programs running in
the VM use the D GC, because that *requires* me to use the Object layout
for runtime objects. That's just not nice, since it adds (IIRC) 3 words
of data that's basically useless to *me*. It would be nice if the GC
supported finalization callbacks similar to how Boehm does it.
Well, considering that there is no reason whatsoever to expect anything
stored in the block except the exact object it was created with, I see no
reason why you couldn't store a TypeInfo reference in the block somewhere
(not part of the object/struct).
This would mean you could determine the type without having the type
system, and it would mean you would not carry around the extra baggage for
calling the finalizer from the GC, when the struct is stored on the stack.
I had great success with this when fixing array appending, I don't see why
it couldn't be done with finalization. We do need compiler support to
make sure the struct dtor function pointer gets stored in the TypeInfo,
not sure if this has already been done.
-Steve