Comparison of CPOOL macro and callable cell pool services

Callable cell pool services are similar to the CPOOL macro, but with some additional capabilities. A program executing in any state or mode (disabled, locked, AR mode, SRB mode, etc.) can use the services to manage storage in data spaces as well as address spaces. The services allow you to define cell boundaries and to expand and contract cell pools. Another difference is in how CPOOL and the callable cell pool services handle the requests to free cells. CPOOL corrupts storage if you try to free a cell that has not been obtained (through CPOOL GET), or if you try to free a cell for a second time. Callable cell pool services accept the request, but do no processing except to return a code to your program.

The following table describes other differences; it can help you decide between the two ways to manage cell pools.

If your program: Use:
Is in AR mode Cell pool services. (CPOOL has mode restrictions.)
Needs to reduce the size of a cell pool Cell pool services. (CPOOL supports expansion but not contraction.)
Needs data space storage Cell pool services. (CPOOL supports only the primary address space.)
Needs storage in an address space other than the primary Cell pool services. (CPOOL supports only primary address space storage.)
Must define cell boundaries Cell pool services. (CPOOL supports only 8-byte boundaries.)
Requires high performance on GETs and FREEs CPOOL.
In some ways, callable cell pool services require more work from the caller than CPOOL does. For example, the services require the following actions that the CPOOL macro does not require: