149 void **mem, |
149 void **mem, |
150 size_t n |
150 size_t n |
151 ); |
151 ); |
152 |
152 |
153 /** |
153 /** |
|
154 * Re-allocate a previously allocated block and changes the pointer in-place, if necessary. |
|
155 * |
|
156 * \par Error handling |
|
157 * \c errno will be set by realloc() on failure. |
|
158 * |
|
159 * @param mem pointer to the pointer to allocated block |
|
160 * @param n the new size in bytes |
|
161 * @return zero on success, non-zero on failure |
|
162 */ |
|
163 #define cx_reallocate(mem, n) cx_reallocate((void**)(mem), n) |
|
164 |
|
165 /** |
154 * Allocate \p n bytes of memory. |
166 * Allocate \p n bytes of memory. |
155 * |
167 * |
156 * @param allocator the allocator |
168 * @param allocator the allocator |
157 * @param n the number of bytes |
169 * @param n the number of bytes |
158 * @return a pointer to the allocated memory |
170 * @return a pointer to the allocated memory |