TAL Reference Manual
Compiler Directives
TAL Reference Manual—526371-001
16-42
HEAP Directive
2. This example disables printing of the global map:
?NOGMAP
HEAP Directive
HEAP sets the size of the CRE user heap for a D-series compilation unit if the ENV
COMMON directive is in effect.
num-pages
is the number of 2048-byte memory pages to allocate for the CRE user heap
(named #HEAP). Specify an unsigned decimal constant in either of the following
ranges:
•
0 through 31—if your program contains C or Pascal small-memory-model
routines
•
0 through 32,767—if your program either:
°
Contains C or Pascal large-memory-model routines
°
Contains no C or Pascal routines
Usage Considerations
HEAP can appear in the compilation command or anywhere in the source code. You
can specify HEAP any number of times. The compiler uses the size specified in the
last HEAP directive encountered in the compilation unit. Use HEAP only with D-series
compilation units that include the ENV COMMON directive. If your program invokes a
routine that needs the user run-time heap, you must use HEAP.
For the small-memory model, Binder allocates the CRE user heap as the last global
data block (just below the data stack) in the user data segment. Your use of the lower
32K-word area of the user data segment determines what heap size you can specify.
For the large-memory model, Binder allocates the CRE user heap as the last data
block in the automatic extended data segment. If you must also allocate an extended
data segment yourself, follow the directions in Appendix B, “Managing Addressing,” in
the
TAL Programmer’s Guide.
For information on using the CRE user heap, see Section 17, Mixed-Language
Programming, in the
TAL Programmer’s Guide.
VST1626.vsd
=
HEAP
num-pages