Struct's alignment

novice2 sorry at noem.ail
Sat Aug 10 15:00:13 PDT 2013


i guess, because of allocated on stack:

import std.stdio;

align(16) struct S
{
   align(16) int a;
}

S sGlobal;

void main()
{
   S sLocal;
   writefln("0x%08X 0x%08X", cast(uint) &sGlobal, cast(uint) 
&sLocal);
}

0x00162110 0x0012FE14

but, IMHO, this is not good


More information about the Digitalmars-d-learn mailing list