Next: , Previous: Logging and debugging, Up: VRRLIB

4.3 Memory allocation

For the memory allocation purposes, the programmer must use the following allocator interface which is prototyped in lib/lib.h (see Main project header). The functions are protected against low memory resulting in process abort on failure and having the same meaning as the original without the x prepended. We mention functions like xmalloc, xfree, xrealloc, etc., consult lib/lib.h for details.

There is also a “small” memory allocator, intended to be used when frequently allocating small memory pieces. See the lib/smalloc.h header for interface. The implementation is in lib/smalloc.c.