ucx
UAP Common Extensions
Loading...
Searching...
No Matches
Data Fields
cx_array_reallocator_s Struct Reference

Defines a reallocation mechanism for arrays. More...

#include <array_list.h>

Data Fields

void *(* realloc )(void *array, size_t capacity, size_t elem_size, struct cx_array_reallocator_s *alloc)
 Re-allocates space for the given array.
 
void * ptr1
 Custom data pointer.
 
void * ptr2
 Custom data pointer.
 
size_t int1
 Custom data integer.
 
size_t int2
 Custom data integer.
 

Detailed Description

Defines a reallocation mechanism for arrays.

Field Documentation

◆ realloc

void *(* cx_array_reallocator_s::realloc) (void *array, size_t capacity, size_t elem_size, struct cx_array_reallocator_s *alloc)

Re-allocates space for the given array.

Implementations are not required to free the original array. This allows re-allocation of static memory by allocating heap memory and copying the array contents. The information in data can keep track of the state of the memory or other additional allocator info.

Parameters
arraythe array to reallocate
capacitythe new capacity (number of elements)
elem_sizethe size of each element
alloca reference to this allocator
Returns
a pointer to the reallocated memory or NULL on failure

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