Top
NetCOBOL V11.0 CBL Subroutines User's Guide
FUJITSU Software

5.1 CBL_ALLOC_MEM

This routine allocates memory.

Specification

Parameter data definition
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.
Calling format
CALL "CBL_ALLOC_MEM"
    USING memory-pointer
    BY VALUE memory-size
             flag
    RETURNING status-code.

Interface

memory-pointer

Specifies the area to store the pointer for allocated memory.

memory-size

Specifies the size of memory to be allocated. The maximum value is 65531.

flag

Specifies the attributes of memory in units of bits. Bit information is as follows:

Bit 0
  • ON: Memory is shared.

  • OFF: Memory is not shared.

Note

Non-shared memory is not supported.

Bit 1
  • 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.

status-code
  • 0: Successful

  • Other than 0: Failure