B: block_pointer = allocate( nwords [, keep ] );
/* C users use "malloc" */
ALLOCATE obtains a block of storage of the specified size from GETVEC and returns a pointer to the block.
If "keep" is not specified, or if "keep" is zero, the storage obtained from ALLOCATE is automatically released when the current function returns. If a non-zero value is specified for "keep", the block of storage is released when the function "keep" levels down the stack returns to its caller. Thus if "keep" is one, the block is released when the caller of your function returns; if "keep" is two the block is released when the caller's caller returns, and so on.
If "keep" is minus one (-1), the block will be released if the top routine of the current co-routine returns. If this is the main co-routine the vector will never be released but be warned that this only applies to the main co-routine. This allows you to return a vector or data structure in an allocated block.
Several auxiliary functions which are related to ALLOCATE are briefly described below.
Copyright © 1996, Thinkage Ltd.