33#ifndef UCX_ALLOCATOR_H
34#define UCX_ALLOCATOR_H
void cxFree(CxAllocator const *allocator, void *mem)
Free a block allocated by this allocator.
CxAllocator * cxDefaultAllocator
A default allocator using standard library malloc() etc.
void(* cx_destructor_func2)(void *data, void *memory)
Function pointer type for destructor functions.
Definition: allocator.h:130
void * cxRealloc(CxAllocator const *allocator, void *mem, size_t n)
Re-allocate the previously allocated block in mem, making the new block n bytes long.
void(* cx_destructor_func)(void *memory)
Function pointer type for destructor functions.
Definition: allocator.h:117
int cx_reallocate(void **mem, size_t n)
Re-allocate a previously allocated block and changes the pointer in-place, if necessary.
void * cxMalloc(CxAllocator const *allocator, size_t n)
Allocate n bytes of memory.
void * cxCalloc(CxAllocator const *allocator, size_t nelem, size_t n)
Allocate nelem elements of n bytes each, all initialized to zero.
int cxReallocate(CxAllocator const *allocator, void **mem, size_t n)
Re-allocate a previously allocated block and changes the pointer in-place, if necessary.
Common definitions and feature checks.
#define __attribute__(x)
Removes GNU C attributes where they are not supported.
Definition: common.h:127
The class definition for an allocator.
Definition: allocator.h:45
Structure holding the data for an allocator.
Definition: allocator.h:86
void * data
A pointer to the data this allocator uses.
Definition: allocator.h:94
cx_allocator_class * cl
A pointer to the instance of the allocator class.
Definition: allocator.h:90