ucx/allocator.c

branch
newapi
changeset 187
24ce2c326d85
parent 174
0358f1d9c506
--- a/ucx/allocator.c	Sun Oct 01 09:23:47 2023 +0200
+++ b/ucx/allocator.c	Sun Oct 01 12:08:09 2023 +0200
@@ -75,6 +75,20 @@
 };
 CxAllocator *cxDefaultAllocator = &cx_default_allocator;
 
+
+int cx_reallocate(
+        void **mem,
+        size_t n
+) {
+    void *nmem = realloc(*mem, n);
+    if (nmem == NULL) {
+        return 1;
+    } else {
+        *mem = nmem;
+        return 0;
+    }
+}
+
 // IMPLEMENTATION OF HIGH LEVEL API
 
 void *cxMalloc(

mercurial