TypeInfo in struct ABI

kinke noone at nowhere.com
Mon Jan 17 21:42:47 UTC 2022


On Monday, 17 January 2022 at 17:15:07 UTC, Teodor Dutu wrote:
> I simply meant that the TypeInfo object is written inside the 
> struct object itself.

That sounds definitely wrong. What's happening OTOH is that the 
GC needs a TypeInfo pointer at the end of each allocated block 
*if* the allocated struct needs to be destructed later on, when 
releasing a page. It's the only type info it has at that point, 
and the TypeInfo knows how to destruct its instances.


More information about the Digitalmars-d mailing list