#include <cx/DataOps.h>void *cxDataObjNew( char *typename )
integer function cxDataObjNew( typename ) character * (*) typename
Only the base structure is created by cxDataObjNew. For example, given a type name of "cxLattice", cxDataObjNew will return a pointer to a cxLattice structure. The ndim, data, dims, and coord fields will be 0 or NULL. Additional memory allocation for arrays is done with cxDataMalloc, cxDataCalloc, and cxDataRealloc. The data's reference count will be 0; the allocation routine should NOT increment the reference count.
Data structures are allocated from a shared memory arena on Silicon Graphics workstations running IRIX. This shared memory is a limited resource, so it is possible for the memory to be exhausted, causing the allocation routine to fail. If there is not enough memory to allocate the structure, a NULL pointer will be returned, and the subroutine cxDataAllocErrorGet will return TRUE. If a user-supplied allocation routine detects the out-of-memory condition after a call to cxDataObjNew, cxDataMalloc, cxDataCalloc, or cxDataRealloc, it is recommended that the allocation routine free all memory it successfully allocated and return NULL. Use cxDataFree to free regular memory, and cxDataRefDec to free any reference-counted structures.