1.2.9 $CODEALIGN : Set the code alignment

This switch sets the code alignment. It takes an argument which is the alignment in bytes.


There are some more arguments which can be specified, to tune the behaviour even more. The general form is


Where PARAM is the parameter to tune, and VAR value is a numerical value specifying an alignment. PARAM can be one of the following strings:

Set the alignment for procedure entry points.
Set the alignment for jump destination locations.
Set alignment for loops (for, while, repeat).
Minimum alignment for constants (both typed and untyped).
Maximum alignment for constants (both typed and untyped).
Minimum alignment for static and global variables.
Maximum alignment for static and global variables.
Minimum alignment for local variables.
Maximum alignment for local variables.
Minimum alignment for record fields.
Maximum alignment for record fields.

By default the size of a data structure determines the alignment:

With the above switches the minimum required alignment and a maximum used alignment can be specified. The maximum allowed alignment is only meaningful if it is smaller than the natural size. i.e. setting the maximum alignment (e.g. VARMAX) to 4, the alignment is forced to be at most 4 bytes: The Int64 will then also be aligned at 4 bytes. The SmallInt will still be aligned at 2 bytes.

These values can also be specified on the command line as