[fpc-pascal] memory layout of arrays

Michael Van Canneyt michael at freepascal.org
Thu Sep 14 11:16:35 CEST 2006

On Thu, 14 Sep 2006, Marc Santhoff wrote:

> Hi,
> when using arrays in C the layout of arrays is sort of flat, since
> pointer arithmetics for accessing values works (e.g. "pointer += 4" for
> 32 bit values).
> Is this the same for pascal/fpc? Do values of for example an integer
> array sit in memory at 4 Byte boundaries?

For integers: normally, yes.

For elements that are smaller than integers, this may depend on the size
and the value of the {$Align} directive. But some of the compiler 
specialists should confirm this.

(and then I'll add a note on this in the programmer's manual)


More information about the fpc-pascal mailing list