ucx
UAP Common Extensions
Loading...
Searching...
No Matches
cx_mempool_s Struct Reference

The basic structure of a memory pool. More...

#include <mempool.h>

Data Fields

const CxAllocator *const base_allocator
 The used allocator, initialized with the cxDefaultAllocator.
 
const CxAllocatorallocator
 The provided allocator.
 
void ** data
 Array of pooled memory.
 
size_t size
 Number of pooled memory items.
 
size_t capacity
 Memory pool capacity.
 
struct cx_mempool_foreign_memory_sregistered
 Array of registered memory.
 
size_t registered_size
 Number of registered memory items.
 
size_t registered_capacity
 Capacity for registered memory.
 
cx_destructor_func destr
 A destructor that shall be called before deallocating a memory block.
 
cx_destructor_func2 destr2
 A destructor that shall be called before deallocating a memory block.
 
void * destr2_data
 Additional data for the destr2.
 

Detailed Description

The basic structure of a memory pool.

Should be the first member of an actual memory pool implementation.

Field Documentation

◆ destr

cx_destructor_func cx_mempool_s::destr

A destructor that shall be called before deallocating a memory block.

This destructor MUST NOT free the memory itself.

It is guaranteed that this destructor is called after the individual destructor of the memory block and before destr2.

◆ destr2

cx_destructor_func2 cx_mempool_s::destr2

A destructor that shall be called before deallocating a memory block.

This destructor MUST NOT free the memory itself.

It is guaranteed that this destructor is called after the individual destructor of the memory block and destr.


The documentation for this struct was generated from the following file: