src/cx/allocator.h

changeset 1424
563033aa998c
parent 1330
dd5d2402d161
equal deleted inserted replaced
1423:9a72258446cd 1424:563033aa998c
269 ); 269 );
270 270
271 /** 271 /**
272 * Reallocate the previously allocated block in @p mem, making the new block 272 * Reallocate the previously allocated block in @p mem, making the new block
273 * @p n bytes long. 273 * @p n bytes long.
274 * This function may return the same pointer that was passed to it, if moving 274 * This function may return the same pointer passed to it if moving
275 * the memory was not necessary. 275 * the memory was not necessary.
276 * 276 *
277 * @note Re-allocating a block allocated by a different allocator is undefined. 277 * @note Re-allocating a block allocated by a different allocator is undefined.
278 * 278 *
279 * @param allocator the allocator 279 * @param allocator the allocator
293 ); 293 );
294 294
295 /** 295 /**
296 * Reallocate the previously allocated block in @p mem, making the new block 296 * Reallocate the previously allocated block in @p mem, making the new block
297 * @p n bytes long. 297 * @p n bytes long.
298 * This function may return the same pointer that was passed to it, if moving 298 * This function may return the same pointer passed to it if moving
299 * the memory was not necessary. 299 * the memory was not necessary.
300 * 300 *
301 * The size is calculated by multiplying @p nemb and @p size. 301 * The size is calculated by multiplying @p nemb and @p size.
302 * If that multiplication overflows, this function returns @c NULL and @c errno 302 * If that multiplication overflows, this function returns @c NULL, and @c errno
303 * will be set. 303 * will be set.
304 * 304 *
305 * @note Re-allocating a block allocated by a different allocator is undefined. 305 * @note Re-allocating a block allocated by a different allocator is undefined.
306 * 306 *
307 * @param allocator the allocator 307 * @param allocator the allocator
328 * This function acts like cxRealloc() using the pointer pointed to by @p mem. 328 * This function acts like cxRealloc() using the pointer pointed to by @p mem.
329 * 329 *
330 * @note Re-allocating a block allocated by a different allocator is undefined. 330 * @note Re-allocating a block allocated by a different allocator is undefined.
331 * 331 *
332 * @par Error handling 332 * @par Error handling
333 * @c errno will be set, if the underlying realloc function does so. 333 * @c errno will be set if the underlying realloc function does so.
334 * 334 *
335 * @param allocator the allocator 335 * @param allocator the allocator
336 * @param mem pointer to the pointer to allocated block 336 * @param mem pointer to the pointer to allocated block
337 * @param n the new size in bytes 337 * @param n the new size in bytes
338 * @retval zero success 338 * @retval zero success
353 * This function acts like cxRealloc() using the pointer pointed to by @p mem. 353 * This function acts like cxRealloc() using the pointer pointed to by @p mem.
354 * 354 *
355 * @note Re-allocating a block allocated by a different allocator is undefined. 355 * @note Re-allocating a block allocated by a different allocator is undefined.
356 * 356 *
357 * @par Error handling 357 * @par Error handling
358 * @c errno will be set, if the underlying realloc function does so. 358 * @c errno will be set if the underlying realloc function does so.
359 * 359 *
360 * @param allocator (@c CxAllocator*) the allocator 360 * @param allocator (@c CxAllocator*) the allocator
361 * @param mem (@c void**) pointer to the pointer to allocated block 361 * @param mem (@c void**) pointer to the pointer to allocated block
362 * @param n (@c size_t) the new size in bytes 362 * @param n (@c size_t) the new size in bytes
363 * @retval zero success 363 * @retval zero success

mercurial