MemCom Reference Manual > MemCom ftn Fortran API > Dynamic Memory Manager (DMM) > mcf_dmm_allocate

Name

mcf_dmm_allocate — Allocate dynamic memory

Description

The mcf_dmm_allocate function allocates an array of size elements in the memory heap and returns the DMM identifier ident. ident is tied to the allocated memory until the memory is explicitly released. Re-allocation (by means of mcf_dmm_reallocate) preserves the identifier, although the allocated memory may reside somewhere else in the memory heap. Reference to the allocated memory must always be made by the pointer dmmptr(ident). Attributes may be added with mcf_dmm_set_attributes (database attributes) and mcf_dmm_set_tag (sets the user tag or user code).

Specification (Fortran)

subroutine mcf_dmm_allocate(type,size,ident,status)


character*4 type
mcf_size size
integer*4 ident
integer*4 status

Parameters

type

Data type of array to be allocated (input). Must be one of I, J, E, F, C, or Z.

size

Number of array data elements to be allocated (input).

ident

DMM identifier returned by the function (output). In case of an error ident remains undefined.

status

Status code returned (output). A value of 0 indicates normal completion of the operation. A negative value indicates an error.