struct field alignment

Jonathan M Davis jmdavisProg at gmx.com
Sun Oct 17 21:38:09 PDT 2010


On Sunday 17 October 2010 20:07:26 Walter Bright wrote:
> 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).

It would be clearer though.

- Jonathna M Davis


More information about the Digitalmars-d mailing list