acnmem.h

Memory management macros and inline functions

All code uses functions or macros defined here to allocate memory.  If you need to use special allocation functions override these.

Summary
acnmem.hAll code uses functions or macros defined here to allocate memory.
Functions
mallocxAllocate memory or exit on failure.
mallocxzAllocate and zero memory or exit on failure.
reallocxRe-allocate memory or exit on failure.
Macros
memory allocation wrappers

Functions

mallocx

static inline void * mallocx(size_t size)

Allocate memory or exit on failure.

Deprecated: Code should check for failure and recover more gracefully.

mallocxz

static inline void * mallocxz(size_t size)

Allocate and zero memory or exit on failure.

Deprecated: Code should check for failure and recover more gracefully.

reallocx

static inline void * reallocx(void *ptr,
size_t size)

Re-allocate memory or exit on failure.

Deprecated: Code should check for failure and recover more gracefully.

Macros

memory allocation wrappers

acnNew(type)create a new variable of the given type, zero it and return a pointer to it.
acnalloc(size)a wrapper for malloc which allows overriding with custom functions.
acnfree(ptr)a wrapper for free which allows overriding with custom functions.
static inline void * mallocx(size_t size)
Allocate memory or exit on failure.
static inline void * mallocxz(size_t size)
Allocate and zero memory or exit on failure.
static inline void * reallocx(void *ptr,
size_t size)
Re-allocate memory or exit on failure.
Close