Peter Norton wrote:
Chuck F wrote:
An integer requires 4 bytes, and must be aligned at
a multiple of 4.
Fairly say I never heard about it must be aligned in record.
Strictly speaking it doesn't *have* to be aligned. On some processors (including Intel x86) unaligned access causes some performance penalty.
Other processors (e.g., Sparc) don't support unaligned access, so the complier has to work around it using partial accesses, shifts, etc. This obviously causes a big performance hit (even more when writing).
So the default is to align properly. This is BTW not specific to Pascal (the Pascal standards don't say anything about alignment), but holds for any language that supports such types at all.
Frank