67 #define ucx_mempool_new_default() ucx_mempool_new(16) void ucx_mempool_free(UcxMempool *pool, void *ptr)
Frees pooled memory.
Definition: mempool.c:187
UCX mempool structure.
Definition: mempool.h:52
void ucx_mempool_destroy(UcxMempool *pool)
Destroys a memory pool.
Definition: mempool.c:209
Main UCX Header providing most common definitions.
int ucx_mempool_chcap(UcxMempool *pool, size_t newcap)
Resizes a memory pool.
Definition: mempool.c:103
void ucx_mempool_reg_destr(UcxMempool *pool, void *ptr, ucx_destructor destr)
Registers a destructor function for the specified (non-pooled) memory.
Definition: mempool.c:229
void * ucx_mempool_malloc(UcxMempool *pool, size_t n)
Allocates pooled memory.
Definition: mempool.c:123
size_t size
Memory pool size.
Definition: mempool.h:63
size_t ndata
Count of pooled memory items.
Definition: mempool.h:60
UCX allocator data structure containing memory management functions.
Definition: allocator.h:88
void * ucx_mempool_calloc(UcxMempool *pool, size_t nelem, size_t elsize)
Allocates a pooled memory array.
Definition: mempool.c:148
void ** data
List of pointers to pooled memory.
Definition: mempool.h:57
UcxMempool * ucx_mempool_new(size_t n)
Creates a memory pool with the specified initial size.
Definition: mempool.c:67
void * ucx_mempool_realloc(UcxMempool *pool, void *ptr, size_t n)
Reallocates pooled memory.
Definition: mempool.c:162
Allocator for custom memory management.
UcxAllocator * allocator
UcxAllocator based on this pool.
Definition: mempool.h:54
void ucx_mempool_set_destr(void *ptr, ucx_destructor func)
Sets a destructor function for the specified memory.
Definition: mempool.c:225
void(* ucx_destructor)(void *)
A function pointer to a destructor function.
Definition: ucx.h:72