From 085b77730a553ce9769fcc76b68772dbde564004 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Thu, 9 May 2024 02:48:06 +0200 Subject: Add custom allocator support to u8upper() --- lib/alloc/alloc_heap.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 lib/alloc/alloc_heap.c (limited to 'lib/alloc/alloc_heap.c') diff --git a/lib/alloc/alloc_heap.c b/lib/alloc/alloc_heap.c new file mode 100644 index 0000000..72cd7ad --- /dev/null +++ b/lib/alloc/alloc_heap.c @@ -0,0 +1,12 @@ +#include + +#include "alloc.h" + +void * +alloc_heap(void *, void *ptr, size_t, size_t new, size_t) +{ + if (new > 0) + return realloc(ptr, new); + free(ptr); + return nullptr; +} -- cgit v1.2.3