On 10 Dec 2010, at 13:08, Luis Fernando Del Aguila Mejía wrote:

Can someone explain to me, about the Data alignment of records and other variables.

The alignment of records (and TP-style objects) is the same as alignment of its fields with the highest alignment requirement. For base types (integers, floating point types, pointers), the alignment depends on the target operating system. For Mac OS X and non-i386 systems, we follow the official ABI (application binary interface) of every system.

For i386-platforms other than Mac OS X, I guess we follow Delphi. I'm not sure whether these rules are documented anywhere, and they were probably implemented based on writing test programs.

Maybe a better question is: why do you want to know the alignment of different data types? Since it can change depending on which platform you are compiling for, writing your code assuming a particular alignment is generally a very bad idea.


Jonas_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to