src/cx/allocator.h

branch
docs/3.1
changeset 1169
6a33a5648027
parent 1134
60edcd57d54c
equal deleted inserted replaced
1168:d92124c8db73 1169:6a33a5648027
63 /** 63 /**
64 * The allocator's calloc() implementation. 64 * The allocator's calloc() implementation.
65 */ 65 */
66 void *(*calloc)( 66 void *(*calloc)(
67 void *data, 67 void *data,
68 size_t nelem, 68 size_t nmemb,
69 size_t n 69 size_t size
70 ); 70 );
71 71
72 /** 72 /**
73 * The allocator's free() implementation. 73 * The allocator's free() implementation.
74 */ 74 */
384 */ 384 */
385 #define cxReallocateArray(allocator, mem, nmemb, size) \ 385 #define cxReallocateArray(allocator, mem, nmemb, size) \
386 cxReallocateArray_(allocator, (void**) (mem), nmemb, size) 386 cxReallocateArray_(allocator, (void**) (mem), nmemb, size)
387 387
388 /** 388 /**
389 * Allocate @p nelem elements of @p n bytes each, all initialized to zero. 389 * Allocate @p nmemb elements of @p n bytes each, all initialized to zero.
390 * 390 *
391 * @param allocator the allocator 391 * @param allocator the allocator
392 * @param nelem the number of elements 392 * @param nmemb the number of elements
393 * @param n the size of each element in bytes 393 * @param size the size of each element in bytes
394 * @return a pointer to the allocated memory 394 * @return a pointer to the allocated memory
395 */ 395 */
396 cx_attr_nonnull_arg(1) 396 cx_attr_nonnull_arg(1)
397 cx_attr_nodiscard 397 cx_attr_nodiscard
398 cx_attr_malloc 398 cx_attr_malloc
399 cx_attr_dealloc_ucx 399 cx_attr_dealloc_ucx
400 cx_attr_allocsize(2, 3) 400 cx_attr_allocsize(2, 3)
401 void *cxCalloc( 401 void *cxCalloc(
402 const CxAllocator *allocator, 402 const CxAllocator *allocator,
403 size_t nelem, 403 size_t nmemb,
404 size_t n 404 size_t size
405 ); 405 );
406 406
407 #ifdef __cplusplus 407 #ifdef __cplusplus
408 } // extern "C" 408 } // extern "C"
409 #endif 409 #endif

mercurial