diff -r 862ab606ee06 -r 04c9f8d8f03b ucx/allocator.c --- a/ucx/allocator.c Sun Feb 16 17:38:07 2025 +0100 +++ b/ucx/allocator.c Tue Feb 25 21:12:11 2025 +0100 @@ -30,7 +30,6 @@ #include -__attribute__((__malloc__, __alloc_size__(2))) static void *cx_malloc_stdlib( cx_attr_unused void *d, size_t n @@ -38,7 +37,6 @@ return malloc(n); } -__attribute__((__warn_unused_result__, __alloc_size__(3))) static void *cx_realloc_stdlib( cx_attr_unused void *d, void *mem, @@ -47,16 +45,14 @@ return realloc(mem, n); } -__attribute__((__malloc__, __alloc_size__(2, 3))) static void *cx_calloc_stdlib( cx_attr_unused void *d, - size_t nelem, - size_t n + size_t nmemb, + size_t size ) { - return calloc(nelem, n); + return calloc(nmemb, size); } -__attribute__((__nonnull__)) static void cx_free_stdlib( cx_attr_unused void *d, void *mem @@ -75,10 +71,9 @@ &cx_default_allocator_class, NULL }; -CxAllocator *cxDefaultAllocator = &cx_default_allocator; +const CxAllocator * const cxDefaultAllocator = &cx_default_allocator; -#undef cx_reallocate -int cx_reallocate( +int cx_reallocate_( void **mem, size_t n ) { @@ -91,8 +86,7 @@ } } -#undef cx_reallocatearray -int cx_reallocatearray( +int cx_reallocatearray_( void **mem, size_t nmemb, size_t size @@ -144,8 +138,7 @@ } } -#undef cxReallocate -int cxReallocate( +int cxReallocate_( const CxAllocator *allocator, void **mem, size_t n @@ -159,8 +152,7 @@ } } -#undef cxReallocateArray -int cxReallocateArray( +int cxReallocateArray_( const CxAllocator *allocator, void **mem, size_t nmemb, @@ -177,10 +169,10 @@ void *cxCalloc( const CxAllocator *allocator, - size_t nelem, - size_t n + size_t nmemb, + size_t size ) { - return allocator->cl->calloc(allocator->data, nelem, n); + return allocator->cl->calloc(allocator->data, nmemb, size); } void cxFree(