cmempool · Section 3
cmempool_calloc_entry
NAME
cmempool_calloc_entry - allocate zero-initialized entry from pool
LIBRARY
C Collections (libccollections, -lccollections)
SYNOPSIS
#include <ccollections/cmempool.h> void *cmempool_calloc_entry(cmempool *mp);
DESCRIPTION
The same as cmempool_alloc_entry(), except that the entry is set to zero before it is returned.
PARAMETERS
mp Memory pool to allocate from
RETURN VALUE
Returns a pointer to the zeroed entry on success Returns NULL when the pool is empty and the fallback is off
NOTES
O(1) complexity The whole element is zeroed Thread-safe if the pool was created with single_threaded=false The function asserts if mp is NULL