Guardian Procedure Calls Reference Manual (G06.25+)
Guardian Procedure Calls (P)
Guardian Procedure Calls Reference Manual—522629-013
12-15
POOL_DEFINE_ Procedure
Each block allocated by the POOL_GETSPACE_ procedure has a tag at the
beginning of the block and a tag at the end of the block. A block boundary tag
serves three purposes:
•
It contains the size of each block so that the program does not need to specify
the length of a block when releasing it.
•
It serves as a check to ensure that the program does not erroneously use more
memory than the block contains (although it does not stop the program from
overwriting).
•
It provides for efficient coalescing of adjacent free blocks.
•
POOL can only be defined on a single segment. It cannot be defined from segment
space of two consecutive logical segments.
The pool space overhead on each block can be substantial if very small blocks are
allocated (in current RVUs, the minimum block size is 32 bytes).
Although pools can also be used to manage the allocation of a collection of equal-
sized blocks, these procedures are not recommended for that purpose because
they can consume more processor time and pool memory than user-written
routines designed for that specific task.
Example
error := POOL_DEFINE_ ( pool, 2048D );
Related Programming Manual
For programming information about the POOL_DEFINE_ memory-management
procedure, refer to the
Guardian Programmer’s Guide.