C/C++ Programmer's Guide (G06.25+)

Compiler Pragmas
HP C/C++ Programmer’s Guide for NonStop Systems429301-008
13-40
HEAP
If both pragmas CPPONLY and HEADERS are specified, CPPONLY takes
precedence.
HEAP
The HEAP pragma specifies the maximum heap size of a program compiled with the
RUNNABLE pragma.
count [ { BYTES | PAGES | WORDS } ]
specifies the maximum size of the heap in terms of a number of units of a given
size. count specifies the number of units, and the keyword following count
specifies the size of each unit. If you omit a keyword, the compiler assumes
BYTES.
The pragma default settings are:
Usage Guidelines
If the RUNNABLE pragma is not specified, the HEAP pragma does not affect the
compilation.
One page equals 2048 bytes (2 kilobytes).
If you do not use the HEAP pragma when compiling a TNS program with the
RUNNABLE pragma, the compiler automatically provides a heap of one page.
For native C/C++, the HEAP pragma must be entered on the compiler RUN
command line; for TNS C and c89 in the OSS environment, the pragma can be
entered either on the compiler RUN command line or in the source text.
Native C and C++ programs use a different heap architecture than TNS programs.
Because of this, native C and C++ programs normally do not need to specify
maximum heap size; the default value for the heap_max attribute of a program file
is zero, indicating that the size of the heap is limited only by available resources.
HEAP count [ { BYTES | PAGES | WORDS } ]
SYSTYPE GUARDIAN SYSTYPE OSS
TNS C compiler HEAP 1 PAGES HEAP 1 PAGES
G-series TNS c89 utility HEAP 1 PAGES HEAP 1 PAGES
TNS/R native C and C++ compilers Not set
(see Usage Guidelines
)
Not set
(see Usage Guidelines)
Native c89 utility Not set
(see Usage Guidelines
)
Not set
(see Usage Guidelines)
TNS/E native C and C++ compilers Not set
(see Usage Guidelines
)
Not set
(see Usage Guidelines)