[Issue 20082] Struct with extern destructor that's never called causes link error

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Jul 25 18:51:52 UTC 2019


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

--- Comment #5 from Rainer Schuetze <r.sagitario at gmx.de> ---
> Nope, it's needed to implement the `destroy(void*)` method.

I don't think it is needed for destroy, the dtor can be called directly.

>>Without D TypeInfo, you'd lose the ability to have dynamic arrays of
>> that extern(C++) struct, associative arrays with that struct as key
>> type etc. etc.

> Why?

It doesn't have to, but that's how dynamic and associative arrays are currently
implemented. There's a GSoC project trying to reduce that dependency.

The typeinfo is also needed to finalize structs that are allocated on the GC
heap.

--


More information about the Digitalmars-d-bugs mailing list