ALLOCNEXT
ALLOCNEXT allocates storage of the specified size in an
AREA if there is enough space in the first available chunk and returns
a pointer to the allocated storage (or if there is not enough space,
it returns sysnull).
- n
- Expression. A nonnegative value that represents the storage size to be allocated. It is rounded up to the nearest multiple of 8. If necessary, n is converted to a size_t value.
- x
- AREA reference.
If the first available chunk in x is large enough, the storage is allocated from x and a pointer to the allocated storage is returned.
If the first available chunk is not large enough, sysnull is
returned. Unlike the ALLOCATE built-in function, neither the STORAGE
nor the AREA condition is raised.
ALLOCNEXT(n,x) generates much shorter and faster code than ALLOCATE(n,x), but the user must check that a non-null pointer is returned. It is best suited when repeated allocations are made from an AREA without any FREEs or when all the FREEs from an AREA are in reverse order from all the ALLOCATEs.
