bio
 
Loading...
Searching...
No Matches
bio_allocator_t Struct Reference

Custom memory allocator. More...

#include <bio.h>

Data Fields

void * ctx
 Allocator context.
 
void *(* realloc )(void *ptr, size_t size, void *ctx)
 Allocation function.
 

Detailed Description

Custom memory allocator.

Field Documentation

◆ ctx

void* bio_allocator_t::ctx

Allocator context.

◆ realloc

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.

Parameters
ptrThe pointer to reallocate or free. This can be NULL.
sizeThe 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.
ctxArbitrary context.
Returns
The (re)allocated memory or NULL when size is 0.

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