Allocate space that may be accessed from C and FORTRAN


This function allocates space in the same way as the standard C malloc() function, except that the pointer to the space allocated is automatically registered (using cnfRegp) for use from both C and FORTRAN. This means that the returned pointer may subsequently be converted into a FORTRAN pointer of type F77_POINTER_TYPE (using cnfFptr), and back into a C pointer (using cnfCptr). The contents of the space may therefore be accessed from both languages.


cpointer = cnfMalloc( size );


size_t size (Given)
The size of the required space.

Returned Value

void cnfMalloc
A registered pointer to the allocated space, or NULL if the space could not be allocated.