struct field alignment

Walter Bright newshound2 at digitalmars.com
Sun Oct 17 20:07:26 PDT 2010


Denis Koroskin wrote:
> On some platforms it is desired to align struct Vec { float[4] data; } 
> on 16 bytes. I don't recall why now, but I know for sure we do that for 
> all platforms (other than PC maybe). I guess that has something to do 
> with vector operations.

I was thinking of special casing such arrays to be 16 byte aligned by default.


> Bikeshed note: how about align(C) to be consistent with both align(1) 
> and extern(C)?

align is shorter than align(C).


More information about the Digitalmars-d mailing list