pTAL Reference Manual (H06.03+)

Structures
HP pTAL Reference Manual523746-005
9-6
SHARED2
If more than one program uses the same source file, you might want to include a
FIELDALIGN clause on every structure declaration in the source file. This ensures that
the field alignment of every structure is consistent across all programs that compile the
source file.
If you do not specify a FIELDALIGN clause, each structure will use the current setting
of the FIELDALIGN compiler directive, which might be different for different
compilations.
Topics:
SHARED2 on page 9-6
SHARED8 on page 9-6
PLATFORM on page 9-7
AUTO on page 9-7
Differences Between PLATFORM and AUTO on page 9-8
SHARED2
FIELDALIGN(SHARED2) directs the compiler to allocate the structure’s fields. Specify
FIELDALIGN(SHARED2) when:
Your process is limited by the available stack space in TAL programs.
You want the structure to hold data (for example, interprocess messages, memory,
or files) that is shared by processes or applications running on a combination of
TAL-compiled processes and RISC and Itanium architectures.
For more information, see FIELDALIGN Clause on page 9-20 and SHARED2
Parameter on page 9-20.
SHARED8
FIELDALIGN(SHARED8) directs the compiler to allocate the structure’s fields for
optimal performance in pTAL. Specify FIELDALIGN(SHARED8) when:
You want optimal performance in pTAL.
The fields you reference in the structure are well-aligned.
All processes that share the data can use SHARED8 alignment.
You want the structure to hold data (for example, interprocess messages, memory,
or files) that is shared by processes or applications that are composed of both
pTAL and TAL code.
In TAL, access to SHARED8 components is as efficient as access to SHARED2
components, but SHARED8 components usually require more space than
SHARED2 components.