|
C Container Collection (CCC)
|
The type passed by reference to any container function that may need to allocate memory. The allocation function controls allocation, resizing, and freeing of memory. The context pointer references any auxiliary information needed to support the allocation function. The context pointer is passed as the context argument of the CCC_Allocator_arguments type, when provided.
More...
#include <types.h>
The type passed by reference to any container function that may need to allocate memory. The allocation function controls allocation, resizing, and freeing of memory. The context pointer references any auxiliary information needed to support the allocation function. The context pointer is passed as the context argument of the CCC_Allocator_arguments type, when provided.
There are a few ways to pass this type when a container function requests a reference to it. First initialize it statically in a module.
Or, construct the context inline.
Or, pass an empty context when allocation is prohibited.
The context provided with this allocator is separate from the context provided to containers that accept context for comparison or hashing functions.
Data Fields | |
| CCC_Allocator_interface * | allocate |
| void * | context |
| CCC_Allocator_interface* CCC_Allocator::allocate |
The allocator function to be passed to an allocating operation.
| void* CCC_Allocator::context |
Additional state to pass to the allocator to help manage memory.