diff options
Diffstat (limited to 'src/allocator.c')
-rw-r--r-- | src/allocator.c | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/src/allocator.c b/src/allocator.c index e4a9f83..c998463 100644 --- a/src/allocator.c +++ b/src/allocator.c @@ -7,43 +7,42 @@ ZIX_MALLOC_FUNC static void* -zix_default_malloc(ZixAllocatorHandle* const handle, const size_t size) +zix_default_malloc(ZixAllocator* const allocator, const size_t size) { - (void)handle; + (void)allocator; return malloc(size); } ZIX_MALLOC_FUNC static void* -zix_default_calloc(ZixAllocatorHandle* const handle, - const size_t nmemb, - const size_t size) +zix_default_calloc(ZixAllocator* const allocator, + const size_t nmemb, + const size_t size) { - (void)handle; + (void)allocator; return calloc(nmemb, size); } static void* -zix_default_realloc(ZixAllocatorHandle* const handle, - void* const ptr, - const size_t size) +zix_default_realloc(ZixAllocator* const allocator, + void* const ptr, + const size_t size) { - (void)handle; + (void)allocator; return realloc(ptr, size); } static void -zix_default_free(ZixAllocatorHandle* const handle, void* const ptr) +zix_default_free(ZixAllocator* const allocator, void* const ptr) { - (void)handle; + (void)allocator; free(ptr); } -const ZixAllocator* +ZixAllocator* zix_default_allocator(void) { - static const ZixAllocator default_allocator = { - NULL, + static ZixAllocator default_allocator = { zix_default_malloc, zix_default_calloc, zix_default_realloc, |