pTAL Conversion Guide

Structures
pTAL Conversion Guide527302-002
11-16
REFALIGNED Clause
REFALIGNED Clause
You can specify the REFALIGNED clause on any pointer field:
STRUCT s;
BEGIN
INT .d REFALIGNED(2); ! Standard pointer with
! REFALIGNED clause
INT .EXT e REFALIGNED(8); ! Extended pointer
END;
Field d is a 16-bit pointer on TNS architecture, but is a 32-bit pointer on native
architecture and is valid only if the field alignment of structure s is AUTO or
PLATFORM.
The same syntax and semantics of fields and pointer fields declared with a
REFALIGNED clause is the same as that of variables and pointers declared with a
REFALIGNED clause, respectively.
Field Alignment
The FIELDALIGN clause and FIELDALIGN compiler directive control how pTAL
allocates memory for the fields of a structure layout and of a definition structure.
Topics:
FIELDALIGN Clause on page 11-16
FIELDALIGN Compiler Directive on page 11-17
Using Field Alignment on page 11-17
Arrays in Structures on page 11-24
Arrays of Structures and Substructures on page 11-24
Optimizing Structure Layouts on page 11-25
Considerations on page 11-27
FIELDALIGN Clause
The FIELDALIGN clause specifies the alignment of a structure and of all substructures
that do not specify a FIELDALIGN clause.
If a definition substructure does not specify a FIELDALIGN clause, the contained
substructure’s field alignment is the field alignment of its encompassing structure or
substructure.