# HG changeset patch # User Mike Becker # Date 1765117996 -3600 # Node ID 91fb10c896115034d7a3e10e6c1a7cb27e068602 # Parent 7c46531efd523bbf49789689489359a925b3b5f9 changes cxFreeDefault() from a macro to a function so that it can be used as a simple destructor diff -r 7c46531efd52 -r 91fb10c89611 src/allocator.c --- a/src/allocator.c Sun Dec 07 13:24:18 2025 +0100 +++ b/src/allocator.c Sun Dec 07 15:33:16 2025 +0100 @@ -243,3 +243,7 @@ ) { allocator->cl->free(allocator->data, mem); } + +void cxFreeDefault(void *mem) { + cxDefaultAllocator->cl->free(cxDefaultAllocator->data, mem); +} diff -r 7c46531efd52 -r 91fb10c89611 src/cx/allocator.h --- a/src/cx/allocator.h Sun Dec 07 13:24:18 2025 +0100 +++ b/src/cx/allocator.h Sun Dec 07 15:33:16 2025 +0100 @@ -439,9 +439,9 @@ */ #define cxReallocArrayDefault(...) cxReallocArray(cxDefaultAllocator, __VA_ARGS__) /** - * Convenience macro that invokes cxFree() with the cxDefaultAllocator. + * Convenience function that invokes cxFree() with the cxDefaultAllocator. */ -#define cxFreeDefault(...) cxFree(cxDefaultAllocator, __VA_ARGS__) +CX_EXPORT void cxFreeDefault(void *mem); #ifdef __cplusplus } // extern "C"