src/cx/allocator.h

changeset 1188
b0300de92b72
parent 1185
d825aca193d3
parent 1169
6a33a5648027
equal deleted inserted replaced
1187:0f70bb04f7ba 1188:b0300de92b72
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 */
393 */ 393 */
394 #define cxReallocateArray(allocator, mem, nmemb, size) \ 394 #define cxReallocateArray(allocator, mem, nmemb, size) \
395 cxReallocateArray_(allocator, (void**) (mem), nmemb, size) 395 cxReallocateArray_(allocator, (void**) (mem), nmemb, size)
396 396
397 /** 397 /**
398 * Allocate @p nelem elements of @p n bytes each, all initialized to zero. 398 * Allocate @p nmemb elements of @p n bytes each, all initialized to zero.
399 * 399 *
400 * @param allocator the allocator 400 * @param allocator the allocator
401 * @param nelem the number of elements 401 * @param nmemb the number of elements
402 * @param n the size of each element in bytes 402 * @param size the size of each element in bytes
403 * @return a pointer to the allocated memory 403 * @return a pointer to the allocated memory
404 */ 404 */
405 cx_attr_nonnull_arg(1) 405 cx_attr_nonnull_arg(1)
406 cx_attr_nodiscard 406 cx_attr_nodiscard
407 cx_attr_malloc 407 cx_attr_malloc
408 cx_attr_dealloc_ucx 408 cx_attr_dealloc_ucx
409 cx_attr_allocsize(2, 3) 409 cx_attr_allocsize(2, 3)
410 cx_attr_export 410 cx_attr_export
411 void *cxCalloc( 411 void *cxCalloc(
412 const CxAllocator *allocator, 412 const CxAllocator *allocator,
413 size_t nelem, 413 size_t nmemb,
414 size_t n 414 size_t size
415 ); 415 );
416 416
417 #ifdef __cplusplus 417 #ifdef __cplusplus
418 } // extern "C" 418 } // extern "C"
419 #endif 419 #endif

mercurial