![]() |
![]()
| ![]() |
![]()
NAMExalloc, xrealloc - memory allocation with simple error check SYNOPSIS# include <begemot.h> void * xalloc(size_t size); void * xrealloc(void *ptr, size_t size); void xfree(void *ptr); DESCRIPTIONThese functions are a layer above the malloc(3C) and realloc(3C) functions. They call these basic functions and check whether the returned pointer is NULL. In this case panic(l) is called with the message 'Out of memory: param' , where param are the parameters to the allocation function. See malloc(3C) and realloc(3C) for a description of the arguments. These functions have the following additional features:
RETURN VALUESee malloc(3C) and realloc(3C) for a description of the return values. Note that these functions never return NULL. SEE ALSOmalloc(3C), realloc(3C), panic(l)
|