On Wednesday, 1 July 2015 at 20:01:08 UTC, dd0s wrote:
intscope_id; // 4
short port; // 8 // -- this is 4 bytes instead of 2
That's expected because scope_id takes 4 bytes, so port has to be
at 8 so it doesn't overlap the preceding int.
The extra two bytes you see in sizeof
i have the following struct, and i expect it to have 30 bytes
but sizeof tells me it has 32 bytes. dmd seems to still use 4byte
alignment altough i specified to align 2bytes.
struct netadr_t {
align(2):
inttype; // 0
intscope_id; // 4
short port; // 8 // -- this is
On Wednesday, 1 July 2015 at 20:01:08 UTC, dd0s wrote:
i have the following struct, and i expect it to have 30 bytes
but sizeof tells me it has 32 bytes. dmd seems to still use
4byte alignment altough i specified to align 2bytes.
struct netadr_t {
align(2):
inttype; // 0
thank you both, indeed missed that truncation step