alloc - allocate C array with error checking
char *alloc(nbytes)
Number of bytes to allocate
Alloc provides dynamic core allocation (via malloc (3)) with error checking. Alloc returns a pointer to a block of at least nbytes characters suitably aligned (after possible pointer coercion) for storage of any type of object.
In order to allocate an array of floating point numbers, use the following command in the calling routine:
float *x; x = (float *) alloc(nx*sizeof(float));
nx is the number of elements needed in the array.
malloc (3)
Alloc terminates program execution with an appropriate error message if core could not be allocated.
alloc malloc memory allocation
sep