add single instance mode
[uwplayer.git] / ucx / allocator.c
index 7ccc6ff..e12255e 100644 (file)
@@ -75,6 +75,20 @@ struct cx_allocator_s cx_default_allocator = {
 };
 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(