|
libsdfio 1.0.0
Reader and writer for ISO 25178-71 SDF surface data files in C
|
Memory management callbacks that replace malloc() and free(), for example with a pool or a bump allocator. More...
#include <types.h>
Data Fields | |
| void * | user |
| Opaque pointer passed as the first argument of both callbacks. | |
| void *(* | allocate )(void *user, size_t size) |
| Returns a block of at least size bytes, aligned for any object type, or null on failure. | |
| void(* | release )(void *user, void *memory) |
| Releases a block returned by allocate. | |
Memory management callbacks that replace malloc() and free(), for example with a pool or a bump allocator.
A header calls them when it is created. A handle calls them for all of its memory, and only when it is created and when a file is created or opened. Reading and writing allocate nothing, so a pool can be sized in advance.
The structure is frozen for the major version: it has these three fields and a new property of an allocator is a new function.
| void(* sdfio_allocator::release) (void *user, void *memory) |
Releases a block returned by allocate.
Never called with null.