pTAL Conversion Guide

Compiler Operation
pTAL Conversion Guide527302-002
19-12
For pTAL and TAL
If you specify BLOCKGLOBALS, the compiler allocates its own data block for each
global variable that is not declared in the scope of a named data block or the private
data block. The name of the data block is the same as the name of the variable
contained in the data block.
Separately compiled modules can share access to a data block only if both modules
allocate the block in the small data area or both modules allocate the block in the large
data area.
References to data in the small data area are faster than references to data in the
large data area.
All data blocks in a shared run-time library must be allocated in the large data area.
If the name of a variable is the same as the name of the data block in which the
variable is located, and the block only contains one variable, the compiler allocates the
data block in the small data area if the length of the block is eight or fewer bytes;
otherwise, the compiler allocates the data block in the large data area. (This is the
allocation strategy used by the native HP C compiler.)
The compiler does not allocate memory for LITERALs, DEFINEs, or templates and,
therefore, does not create an implicit global data block for these items.
Indirect and extended arrays and structures are allocated in a data block named
$_GLOBAL. For a summary of data block names for object files you will run as TNS
processes, see Table 19-6 on page 19-13.
Default: The compiler allocates data items in the _GLOBAL data block
Placement: Before the first data declaration in a compilation
Scope: Applies to the compilation unit
Dependencies:
Has no effect without the USEGLOBALS directive
If you specify either SAVEGLOBALS or USEGLOBALS, your
compilation unit must have exactly one BEGINCOMPILATION
directive
Table 19-5. Data Block Names
Declaration
Without BLOCKGLOBALS With BLOCKGLOBALS
Pointer Data Pointers and Data
INT a; Not applicable _GLOBAL A
INT .a; Not applicable _GLOBAL A
INT .EXT a; Not applicable _GLOBAL A
INT a[0:9] Not applicable _GLOBAL A
STRUCT a;
BEGIN
INT i;
END
Not applicable _GLOBAL A