This routine allocates memory.
Specification
01 memory-pointer USAGE POINTER. 01 memory-size PIC S9(9) COMP-5. 01 flag PIC S9(9) COMP-5. 01 status-code PIC S9(4) COMP-5.
CALL "CBL_ALLOC_MEM" USING memory-pointer BY VALUE memory-size flag RETURNING status-code.
Interface
Specifies the area to store the pointer for allocated memory.
Specifies the size of memory to be allocated. The maximum value is 65531.
Specifies the attributes of memory in units of bits. Bit information is as follows:
ON: Memory is shared.
OFF: Memory is not shared.
Note
Non-shared memory is not supported.
ON: Allocated memory cannot be reallocated.
OFF: Allocated memory can be reallocated.
Return code
The return code is set in the status-code specified in the RETURNING clause.
0: Successful
Other than 0: Failure