MALLOC - dynamic storage allocation.

(ANSI Standard)

Usage:

#include <stdlib.h>
ptr = malloc( size );

Where:

size_t size;
tells the number of bytes of memory that should be obtained.
void *ptr;
points to the memory that has been obtained.

Description:

"malloc" returns a pointer to space starting at an alignment boundary suitable for storing an object of any type. This space is at least "size" bytes long.

Notes:

The UNIX version of "malloc" returns a NULL pointer if the desired amount of memory cannot be obtained. This doesn't happen with SS mode C -- if a program asks for more memory and is denied, the program is automatically aborted by TSS. Thus, in SS mode C, "malloc" never returns the NULL pointer.

See Also:

expl c lib calloc

expl c lib realloc

expl c lib free

Copyright © 1996, Thinkage Ltd.