malloc, free, realloc, calloc \- main memory allocator
.B char *realloc(ptr, size)
.B char *calloc(nelem, elsize)
.B unsigned nelem, elsize;
provide a simple general-purpose memory allocation package.
returns a pointer to a block of at least
bytes beginning on a word boundary.
is a pointer to a block previously allocated by
this space is made available for further allocation,
but its contents are left undisturbed.
Needless to say, grave disorder will result if the space
is overrun or if some random number is handed to
allocates the first big enough contiguous reach of
found in a circular search from the last
block allocated or freed,
coalescing adjacent free blocks as it searches.
to get more memory from the system when there is no
suitable space already free.
changes the size of the block pointed to by
bytes and returns a pointer to the (possibly moved)
The contents will be unchanged up to the
lesser of the new and old sizes.
points to a block freed since the last call of
can exploit the search strategy of
to do storage compaction.
The space is initialized to zeros.
Each of the allocation routines returns a pointer
to space suitably aligned (after possible pointer coercion)
for storage of any type of object.
return a null pointer (0) if there is no available memory
or if the arena has been detectably corrupted by storing outside the bounds
may be recompiled to check the arena very stringently