cvector · Section 3
cvector_get_mprocs
NAME
cvector_get_mprocs - get the memory management procedures of a vector
LIBRARY
C Collections (libccollections, -lccollections)
SYNOPSIS
#include <ccollections/cvector.h> ccol_memmgmt_procs *cvector_get_mprocs(cvec v);
DESCRIPTION
Returns the memory management procedures that the vector allocates through, so code handed an existing vector can allocate scratch storage from the same allocator.
PARAMETERS
v Vector to query
RETURN VALUE
A pointer to the vector's memory management procedures. NULL when the vector was created with the default allocator, that is when the mmgmt_procs argument of cvector_create_full() was NULL.
NOTES
A NULL return isn't an error. It means "use the library's defaults", and every routine of the library that takes a ccol_memmgmt_procs * accepts NULL with exactly that meaning. The structure belongs to the library and stays valid until the vector is destroyed, so don't free it yourself and don't use it after the destroy. Asserts if v is NULL.