186 * @param n (@c size_t) the new size in bytes |
186 * @param n (@c size_t) the new size in bytes |
187 * @retval zero success |
187 * @retval zero success |
188 * @retval non-zero failure |
188 * @retval non-zero failure |
189 * @see cx_reallocatearray() |
189 * @see cx_reallocatearray() |
190 */ |
190 */ |
191 #define cx_reallocate(mem, n) cx_reallocate((void**)(mem), n) |
191 #define cx_reallocate(mem, n) cx_reallocate_((void**)(mem), n) |
192 |
192 |
193 /** |
193 /** |
194 * Re-allocate a previously allocated block and changes the pointer in-place, |
194 * Re-allocate a previously allocated block and changes the pointer in-place, |
195 * if necessary. |
195 * if necessary. |
196 * |
196 * |
205 * @param size (@c size_t) the size of each element |
205 * @param size (@c size_t) the size of each element |
206 * @retval zero success |
206 * @retval zero success |
207 * @retval non-zero failure |
207 * @retval non-zero failure |
208 */ |
208 */ |
209 #define cx_reallocatearray(mem, nmemb, size) \ |
209 #define cx_reallocatearray(mem, nmemb, size) \ |
210 cx_reallocatearray((void**)(mem), nmemb, size) |
210 cx_reallocatearray_((void**)(mem), nmemb, size) |
211 |
211 |
212 /** |
212 /** |
213 * Free a block allocated by this allocator. |
213 * Free a block allocated by this allocator. |
214 * |
214 * |
215 * @note Freeing a block of a different allocator is undefined. |
215 * @note Freeing a block of a different allocator is undefined. |
331 * @param n (@c size_t) the new size in bytes |
331 * @param n (@c size_t) the new size in bytes |
332 * @retval zero success |
332 * @retval zero success |
333 * @retval non-zero failure |
333 * @retval non-zero failure |
334 */ |
334 */ |
335 #define cxReallocate(allocator, mem, n) \ |
335 #define cxReallocate(allocator, mem, n) \ |
336 cxReallocate(allocator, (void**)(mem), n) |
336 cxReallocate_(allocator, (void**)(mem), n) |
337 |
337 |
338 /** |
338 /** |
339 * Re-allocate a previously allocated block and changes the pointer in-place, |
339 * Re-allocate a previously allocated block and changes the pointer in-place, |
340 * if necessary. |
340 * if necessary. |
341 * This function acts like cxReallocArray() using the pointer pointed to |
341 * This function acts like cxReallocArray() using the pointer pointed to |
381 * @param size (@c size_t) the size of each element |
381 * @param size (@c size_t) the size of each element |
382 * @retval zero success |
382 * @retval zero success |
383 * @retval non-zero failure |
383 * @retval non-zero failure |
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 nelem elements of @p n bytes each, all initialized to zero. |
390 * |
390 * |
391 * @param allocator the allocator |
391 * @param allocator the allocator |