ucx/allocator.c

changeset 775
e5909dff0dbf
parent 747
efbd59642577
--- a/ucx/allocator.c	Sun Jul 02 12:06:45 2023 +0200
+++ b/ucx/allocator.c	Sun Jul 02 13:23:51 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