cmempool · Section 3
crmempool_dynamic_allocs_count
NAME
crmempool_dynamic_allocs_count - get number of dynamic allocations
LIBRARY
C Collections (libccollections, -lccollections)
SYNOPSIS
#include <ccollections/cmempool.h> size_t crmempool_dynamic_allocs_count(crmempool *rmp, size_t size);
DESCRIPTION
Returns the number of heap entries for the given size. Which entries that covers depends on the fallback policy.
PARAMETERS
rmp Ranged memory pool to query size Size in bytes to query
RETURN VALUE
Returns the number of dynamic entries Returns 0 when size is invalid, and 0 when the fallback is off
NOTES
Returns 0 for crmempool_fallback_disabled With crmempool_fallback_at_first_exhaustion the dynamic entries are tracked for each pool separately With crmempool_fallback_at_last_exhaustion every dynamic entry is tracked together Returns 0 if the size is invalid, which means 0 or above largest_size Asserts if rmp is NULL Thread-safe if the pool was created with single_threaded=false