vt_allocation 7 2016-03-05 genvector manual

NAME

vt_allocation - user defined memory allocator

SYNPOSIS

#define GVT_REALLOC(vect, ptr, size) realloc(ptr, size)

#define GVT_FREE(vect, ptr) free(ptr)

DESCRIPTION

Macros GVT_REALLOC and GVT_FREE have to be defined during instantiation because the instance code will use exclusively these macros to allocate and free memory. The vect argument is the vector pointer; this might be useful if there are allocation contexts, e.g. slab allocation with different slab sizes or groups per vector. Other than the vect argument and the actual type of size, the API is compatible with C89 realloc() and free().

GVT_REALLOC may be called with ptr == NULL but is never called with size

GVT_FREE is never called with ptr == NULL.

SEE ALSO

vt_allocation 7 2016-03-05 genvector manual