DEFINITION - FUNCTION
addr& = AllocGPMVec&(getSize&, flags&)
-- allocate memory and keep track of the size
OPERATION
This function works identically to AllocGPMem&, but tracks the size
of the allocation.
ARGUMENTS
getSize& -- the size of the desired block in bytes (The GPM system
will automatically round this number to a multiple of the
minimum supported memory block size)
flags& -- a bit field with any special characteristics (see below)
RESULT
addr& -- a pointer to the newly allocated memory block. If there
are no free memory regions large enough to satisfy the
request, zero will be returned.
NOTES
1.) The result of any memory allocation must be checked, and a viable
error handling path taken. Any allocation may fail if memory has
been filled.
2.) If the free memory list is corrupt, the GPM system will panic with
an error.
FLAGS
The flags& defined in the include file memory.bi are bit-coded values,
hence they can easily combined by ORing or adding them:
gpmF_NoAdd& -- Don't try to extend the current GP Memory region, if
there is not enough free space to satisfy the request.
gpmF_Clear& -- The just allocated memory block will be initialized
to all zeros.
SEE ALSO
Allocating GP Memory
Back to Function Reference