| 176 * and copying the array contents. The information in the custom fields of |
176 * and copying the array contents. The information in the custom fields of |
| 177 * the referenced allocator can be used to track the state of the memory |
177 * the referenced allocator can be used to track the state of the memory |
| 178 * or to transport other additional data. |
178 * or to transport other additional data. |
| 179 * |
179 * |
| 180 * @param array the array to reallocate |
180 * @param array the array to reallocate |
| 181 * @param capacity the new capacity (number of elements) |
181 * @param old_capacity the old number of elements |
| |
182 * @param new_capacity the new number of elements |
| 182 * @param elem_size the size of each element |
183 * @param elem_size the size of each element |
| 183 * @param alloc a reference to this allocator |
184 * @param alloc a reference to this allocator |
| 184 * @return a pointer to the reallocated memory or @c NULL on failure |
185 * @return a pointer to the reallocated memory or @c NULL on failure |
| 185 */ |
186 */ |
| 186 cx_attr_nodiscard |
187 cx_attr_nodiscard |
| 187 cx_attr_nonnull_arg(4) |
188 cx_attr_nonnull_arg(5) |
| 188 cx_attr_allocsize(2, 3) |
189 cx_attr_allocsize(3, 4) |
| 189 void *(*realloc)( |
190 void *(*realloc)( |
| 190 void *array, |
191 void *array, |
| 191 size_t capacity, |
192 size_t old_capacity, |
| |
193 size_t new_capacity, |
| 192 size_t elem_size, |
194 size_t elem_size, |
| 193 struct cx_array_reallocator_s *alloc |
195 struct cx_array_reallocator_s *alloc |
| 194 ); |
196 ); |
| 195 |
197 |
| 196 /** |
198 /** |