https://issues.dlang.org/show_bug.cgi?id=21693

--- Comment #5 from [email protected] ---
(In reply to kinke from comment #3)
> The GC could presumably handle C++ classes like structs, where the
> TypeInfo_Struct pointer is stored after the struct instance IIRC. For C++
> classes, it could store the D TypeInfo_Class pointer after the class
> instance (but note that class instances have no tail padding, so some
> padding might be needed for an aligned TypeInfo pointer).

That would be fine. The maximum overhead would be less than (size_t.sizeof *
2), which is no big deal if it gets RAII working properly.

Is it necessary to store a TypeInfo pointer for every instance, though? Garbage
collected instances would all be allocated on the D side, so I would think that
the TypeInfo data could just be stored adjacent to D's copy of the vtable.

--

Reply via email to