diff -r c9b882bef838 -r 44986c0e2b05 src/allocator.c --- a/src/allocator.c Tue Jun 27 20:04:48 2023 +0200 +++ b/src/allocator.c Wed Jun 28 19:18:01 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(