HP C/iX Library Reference Manual (30026-90004)
244 Chapter5
HP C/iX Library Function Descriptions
malloc
malloc
Allocates a block of memory.
Syntax
#include <stdlib.h>
void *malloc (size_t
size
);
Parameters
size
The number of bytes in the block to be allocated.
Return Values
x A pointer to an allocated block of memory.
NULL There is not enough memory available, or
size
is 0.
Description
The malloc function returns a pointer to a block of at least
size
bytes suitably aligned for
any use.
The malloc and free functions provide a simple generalized memory allocation package.
Undeļ¬ned results occur if the space assigned by malloc() is overrun.
See Also
free(), realloc(), calloc(), ANSI C 4.10.3.3, POSIX.1 8.1