diff -r dc1bfe5ffd38 -r 3539dd99ab92 src/cx/allocator.h --- a/src/cx/allocator.h Sun Feb 07 16:52:21 2021 +0100 +++ b/src/cx/allocator.h Sun Feb 07 17:17:46 2021 +0100 @@ -44,18 +44,20 @@ void* cx_calloc_stdlib(cx_allocator a, size_t nelem, size_t n); void cx_free_stdlib(cx_allocator a, void* mem); -struct cx_allocator_class { +typedef struct { cx_malloc_func malloc; cx_realloc_func realloc; cx_calloc_func calloc; cx_free_func free; -}; +} cx_allocator_class; + +extern cx_allocator_class cx_default_allocator_class; /* HIGH LEVEL API */ struct cx_allocator_s { - struct cx_allocator_class allocatorClass; - void* data; + cx_allocator_class *cl; + cx_allocator data; }; typedef struct cx_allocator_s* CxAllocator;