Structure is a hierarchically ordered set of values that may be of different data types. The immediate components of a structure are called "members" of the structure. An entire structure can be transmitted in stream or record I/O, passed as an argument, or assigned to another structure of identical size and shape and having members of corresponding identical data types. No conversions or calculations can be performed on entire structures.
Size
|
Alignment
|
Sum of members + gaps for alignment
|
Most stringent of members' alignment requirements
|
In Open-PL/I, structure mapping is as follows:
- Each member is aligned to its natural boundary (offset from the start of the structure) as determined by the native machine architecture. Each member offset is effectively "pushed ahead" to map to its natural boundary, and where necessary, pad bytes may be introduced.
- The alignment of the top-level structure (and substructures) will inherit the most stringent alignment requirement of its members.