Where is TypeInfo_Class.m_init set

Hakan Aras hakan.aras at live.at
Thu Aug 2 14:25:09 UTC 2018


On Thursday, 2 August 2018 at 10:54:17 UTC, kinke wrote:

> Those 4 bytes for the struct is trailing padding, so that the 
> struct is 16 bytes large, a multiple of its 8-bytes alignment 
> (due to the pointer). Classes on the other hand aren't padded 
> (they don't need to be, as there are no contiguous arrays of 
> class instances, just class references).
> In this case, you could use `align(1) struct BazInitializer` to 
> prevent the struct tail padding.

Oh yeah, forgot about alignment. It's no use though. Unless I can 
get my hands on the internal "struct" type of Baz somehow, LDC is 
not gonna let me declare it:

https://github.com/ldc-developers/ldc/blob/69104bdbf94713431cbc67151c1b34a6a5e0df34/gen/llvmhelpers.cpp#L1759


More information about the Digitalmars-d-learn mailing list