--- a/src/cx/allocator.h Mon Feb 10 21:30:51 2025 +0100 +++ b/src/cx/allocator.h Mon Feb 10 20:59:02 2025 +0100 @@ -100,7 +100,8 @@ /** * A default allocator using standard library malloc() etc. */ -extern CxAllocator *cxDefaultAllocator; +cx_attr_export +extern const CxAllocator * const cxDefaultAllocator; /** * Function pointer type for destructor functions. @@ -145,6 +146,7 @@ */ cx_attr_nonnull cx_attr_nodiscard +cx_attr_export int cx_reallocate_( void **mem, size_t n @@ -169,6 +171,7 @@ */ cx_attr_nonnull cx_attr_nodiscard +cx_attr_export int cx_reallocatearray_( void **mem, size_t nmemb, @@ -218,6 +221,7 @@ * @param mem a pointer to the block to free */ cx_attr_nonnull_arg(1) +cx_attr_export void cxFree( const CxAllocator *allocator, void *mem @@ -235,6 +239,7 @@ cx_attr_malloc cx_attr_dealloc_ucx cx_attr_allocsize(2) +cx_attr_export void *cxMalloc( const CxAllocator *allocator, size_t n @@ -257,6 +262,7 @@ cx_attr_nonnull_arg(1) cx_attr_dealloc_ucx cx_attr_allocsize(3) +cx_attr_export void *cxRealloc( const CxAllocator *allocator, void *mem, @@ -285,6 +291,7 @@ cx_attr_nonnull_arg(1) cx_attr_dealloc_ucx cx_attr_allocsize(3, 4) +cx_attr_export void *cxReallocArray( const CxAllocator *allocator, void *mem, @@ -310,6 +317,7 @@ */ cx_attr_nodiscard cx_attr_nonnull +cx_attr_export int cxReallocate_( const CxAllocator *allocator, void **mem, @@ -356,6 +364,7 @@ */ cx_attr_nodiscard cx_attr_nonnull +cx_attr_export int cxReallocateArray_( const CxAllocator *allocator, void **mem, @@ -398,6 +407,7 @@ cx_attr_malloc cx_attr_dealloc_ucx cx_attr_allocsize(2, 3) +cx_attr_export void *cxCalloc( const CxAllocator *allocator, size_t nelem,