Manual page for bsdmalloc(3X)
bsdmalloc, malloc, free, realloc - memory allocator
[ flag ... ] file ...
[ library ... ]
char *malloc( size)
int free( ptr)
char * ptr;
char *realloc( ptr, size)
These routines provide a general-purpose memory allocation
package. They maintain a table of free blocks for efficient
allocation and coalescing of free storage. When there is no
suitable space already free, the allocation routines call
to get more memory from the system.
Each of the allocation routines returns a pointer to space
suitably aligned for storage of any type of object. Each
returns a NULL pointer if the request cannot be completed
returns a pointer to a block of at least
bytes, which is appropriately aligned.
releases a previously allocated block. Its argument
is a pointer to a block previously allocated by
changes the size of the block referenced by
bytes and returns a pointer to the (possibly moved)
block. The contents will be unchanged up to the lesser of
the new and old sizes. If unable to honor a reallocation
leaves its first argument unaltered. For
accepts a pointer to a
block freed since the most recent call to
pointer if there is not enough available memory.
the block pointed to by
is left intact.
will be set to indicate the following:
bytes of memory exceeds the physical limits of your system, and cannot be allocated.
There is not enough memory available AT THIS POINT IN TIME to allocate
bytes of memory; but the application could try again later.
Use of libbsdmalloc renders an application non-SCD compliant.
libbsdmalloc routines are incompatible with the memory allocation routines in the standard
with a block freed before the
most recent call to
will result in an error.
return a non-NULL pointer if
is 0. These pointers should not be dereferenced.
Always cast the value returned by
Comparative Features of
routines afford better performance, but are space-inefficient.
routines are space-efficient, but have slower performance.
The standard, fully SCD-compliant
routines are a trade-off between
performance and space-efficiency.
does not set
Created by unroff & hp-tools.
© by Hans-Peter Bischof. All Rights Reserved (1997).
Last modified 21/April/97