C Container Collection (CCC)
Loading...
Searching...
No Matches
CCC_Allocator_arguments Struct Reference

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>

Detailed Description

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
 

Field Documentation

◆ bytes

size_t CCC_Allocator_arguments::bytes

The bytes being requested from the allocator. 0 is a free request.

◆ context

void* const CCC_Allocator_arguments::context

Additional state to pass to the allocator to help manage memory.

◆ input

void* const CCC_Allocator_arguments::input

The input to the allocation function. NULL or previously allocated.


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