fpt and WinFPT Reference Manual - Command-line Commands
| SimCon Home | Ref Manual Home |
STRUCTURE ALIGNMENT GRANULARITY
Syntax:
STRUCTURE ALIGNMENT GRANULARITY [:] <integer> [BYTE[S]]
Function:
Most systems access memory more efficiently if objects occupy aligned addresses, ie. addresses which are multiples of 4 or 8 bytes. Some compilers will leave empty spaces within derived types and structures in order to align the addresses of the type components and structure fields. The command STRUCTURE ALIGNMENT GRANULARITY specifies the spacing of aligned addresses. The command ALIGNMENT GRANULARITY specifies the spacing of aligned addresses of local variables and of variables in COMMON blocks.
By default fpt assumes that objects in derived types and structures are not forced to aligned addresses. fpt may be instructed to leave spaces in derived types, structures and COMMON blocks by the commands ALIGN OBJECTS IN STRUCTURES and ALIGN OBJECTS IN COMMON BLOCKS.
The alignment granularity rules used by most compilers, and by fpt, are that:
Where to Use this Command
| Operating system command line | Yes |
| Configuration file, config.fsp | Yes |
| Specification (fsp) files, *.fsp | Yes |
| Interactively, to FPT> prompt | No |
| Interactive command files | No |
| Embedded in the Fortran code | No |
Note that the alignment granularity used by the command ALIGN OBJECTS IN STRUCTURES cannot be specified interactively because addresses within derived types and structures are computed before fpt enters interactive mode.
Default
STRUCTURE ALIGNMENT GRANULARITY : 4 BYTES
See Also
Copyright ©1995 to 2025 Software Validation Ltd. All rights reserved.