ucx
UAP Common Extensions
|
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. | |
Defines a reallocation mechanism for arrays.
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.
array | the array to reallocate |
capacity | the new capacity (number of elements) |
elem_size | the size of each element |
alloc | a reference to this allocator |
NULL
on failure