|
C Container Collection (CCC)
|
A bundle of arguments to pass to the user-implemented Allocator_interface function interface. This ensures clarity in inputs and expected outputs to an allocator function the user wishes to use for managing containers. Additional context can be provided for more complex allocation schemes. More...
#include <types.h>
A bundle of arguments to pass to the user-implemented Allocator_interface function interface. This ensures clarity in inputs and expected outputs to an allocator function the user wishes to use for managing containers. Additional context can be provided for more complex allocation schemes.
The pointers are const to bind the input closely with its context, if context is provided. Because container code is providing the user a reference to a user type it currently stores, or data it manages, it is critical the user does not accidentally move or misuse the pointer to jeopardize container invariants.
Data Fields | |
| void *const | input |
| size_t | bytes |
| void *const | context |
| size_t CCC_Allocator_arguments::bytes |
The bytes being requested from the allocator. 0 is a free request.
| void* const CCC_Allocator_arguments::context |
Additional state to pass to the allocator to help manage memory.
| void* const CCC_Allocator_arguments::input |
The input to the allocation function. NULL or previously allocated.