Description: | Allocates a block of memory.[1] | ||
Class: | Elemental function; Specific | ||
Arguments: | I must be of type INTEGER(4). This value is the size (in bytes) of memory to be allocated. | ||
Results: | The result type is INTEGER(4) on Intel processors; INTEGER(8) on Alpha processors. The result is the starting address of the allocated memory. The memory allocated can be freed by using the FREE intrinsic function (see Section 9.3.53). | ||
[1] This specific function cannot be passed as an actual argument. |
Examples
Consider the following:
INTEGER(4) ADDR, SIZE
SIZE = 1024 ! Size in bytes
ADDR = MALLOC(SIZE) ! Allocate the memory
CALL FREE(ADDR) ! Free it
END