Open System Services Programmer's Guide

In the OSS environment, communication between processes using shared memory, message queues,
semaphores, and pipe functions is considered to be interprocess communication—rather than
memory management. OSS interprocess-communication functions are discussed in “Interprocess
Communication” (page 174).
Pool Functions
Frequently, portions of a memory segment are utilized for independent purposes. A prime example
is the heap: the C standard functions malloc(), calloc(), realloc(), and free(), and the
C++ operators new and delete, manage portions of the process heap. These facilities are the
same in Guardian and OSS processes. In addition to the standard functions, the Common Runtime
Environment library also offers some functions for control and diagnosis of the heap:
heap_check() – Checks the consistency of the run-time heap.
heap_check_always() – Controls whether the run-time heap consistency is checked
automatically.
heap_min_block_size() – Specifies the minimum block size to attempt to use when
allocating from the heap.
For various reasons, a program might need to perform similar sub-allocations from some other
segment. Beginning with the H06.20 and J06.09 RVUs, the system provides a set of efficient
Guardian procedures to manage a heap or pool defined by the program. These procedures
accommodate 64-bit addresses, and can manage multiple disjoint areas (typically in different
segments) as a single pool.
POOL64_AUGMENT_ – Adds a disjoint memory area to the pool.
POOL64_CHECK_ – Performs a diagnostic scan of the pool.
POOL64_CHECK_SHRINK_ – Checks whether the pool can be made smaller while retaining
its contents.
POOL64_DEFINE_ – Specifies the virtual address space and initializes the pool.
POOL64_DIMINISH_ – Removes an augmentation area from the pool.
POOL64_GET_ – Allocates a block of space from the pool, analogous to malloc().
POOL64_GETINFO_ – Reads summary statistics from the pool.
POOL64_PUT_ – Returns a previously allocated block to the pool, analogous to free().
POOL64_RESIZE_ – Shrinks or enlarges a single-segment pool.
For more information about these 64-bit pool procedures, see the Guardian Procedure Calls
Reference Manual in the NTL.
NOTE: Another set of pool procedures is available on all supported NonStop systems. They
support only 32-bit addressing, and are less efficient than the POOL64_* procedures. The 32–bit
pool procedures are named POOL_*, and are also documented in the Guardian Procedure Calls
Reference Manual.
Pool Functions 165