aboutsummaryrefslogtreecommitdiff
path: root/lib/alloc/alloc_heap.c
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2024-05-09 02:48:06 +0200
committerThomas Voss <mail@thomasvoss.com> 2024-05-09 02:48:06 +0200
commit085b77730a553ce9769fcc76b68772dbde564004 (patch)
tree328ae4f715300cb5c028ad0e7ffc2e13a5c9c72a /lib/alloc/alloc_heap.c
parent20fa17a5f2a286f44bdafff6dc4bb58e7667fe46 (diff)
Add custom allocator support to u8upper()
Diffstat (limited to 'lib/alloc/alloc_heap.c')
-rw-r--r--lib/alloc/alloc_heap.c12
1 files changed, 12 insertions, 0 deletions
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 <stdlib.h>
+
+#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;
+}