[fpc-devel] data alignment and int64 (or qword, maybe any single piece of size 8 if any)

Daniël Mantione daniel.mantione at freepascal.org
Mon May 15 14:10:28 CEST 2006



Op Mon, 15 May 2006, schreef ???? ???????????:

>   b= record
>      ab: int64;
>      c: longword;
>      end; // 12 expected

> writeln(sizeof(b)); // 16    ???

Suppose you have an array of b. Then, with a size of 12, there would be no 
guarantee that an access to b.ab is aligned. So, the compiler pads the 
record to a multiple of the largest field.

Daniël


More information about the fpc-devel mailing list