Custom memory allocator. More...
#include <bio.h>
Data Fields | |
void * | ctx |
Allocator context. | |
void *(* | realloc )(void *ptr, size_t size, void *ctx) |
Allocation function. | |
Custom memory allocator.
void* bio_allocator_t::ctx |
Allocator context.
void *(* bio_allocator_t::realloc) (void *ptr, size_t size, void *ctx) |
Allocation function.
This should behave like stdlib realloc
.
This will only be called from the main thread so synchronization is not necessary.
ptr | The pointer to reallocate or free. This can be NULL . |
size | The size to (re)allocate. When this is 0, the memory pointed to by ptr should be freed. Freeing a NULL pointer is not an error. |
ctx | Arbitrary context. |
NULL
when size
is 0.