Re-allocation where the expanded part is initialized to zero. More...
Functions | |
| void * | mi_rezalloc (void *p, size_t oldsize, size_t newsize) |
| Re-allocate memory to newsize bytes, with the memory from oldsize initialized to zero. | |
| void * | mi_recalloc (void *p, size_t oldcount, size_t newcount, size_t size) |
| Re-allocate memory to newcount elements of size bytes, with the elements from oldcount initialized to zero. | |
| void * | mi_rezalloc_aligned (void *p, size_t oldsize, size_t newsize, size_t alignment) |
| As mi_rezalloc() but the returned block is aligned to alignment. | |
| void * | mi_rezalloc_aligned_at (void *p, size_t oldsize, size_t newsize, size_t alignment, size_t offset) |
| As mi_rezalloc() but the returned block is aligned by alignment at a specified offset. | |
| void * | mi_recalloc_aligned (void *p, size_t oldcount, size_t newcount, size_t size, size_t alignment) |
| As mi_recalloc() but the returned block is aligned to alignment. | |
| void * | mi_recalloc_aligned_at (void *p, size_t oldcount, size_t newcount, size_t size, size_t alignment, size_t offset) |
| As mi_recalloc() but the returned block is aligned by alignment at a specified offset. | |
| void * | mi_heap_rezalloc (mi_heap_t *heap, void *p, size_t oldsize, size_t newsize) |
| As mi_rezalloc() but allocates in a specific heap. | |
| void * | mi_heap_recalloc (mi_heap_t *heap, void *p, size_t oldcount, size_t newcount, size_t size) |
| As mi_recalloc() but allocates in a specific heap. | |
| void * | mi_heap_rezalloc_aligned (mi_heap_t *heap, void *p, size_t oldsize, size_t newsize, size_t alignment) |
| As mi_rezalloc_aligned() but allocates in a specific heap. | |
| void * | mi_heap_rezalloc_aligned_at (mi_heap_t *heap, void *p, size_t oldsize, size_t newsize, size_t alignment, size_t offset) |
| As mi_rezalloc_aligned_at() but allocates in a specific heap. | |
| void * | mi_heap_recalloc_aligned (mi_heap_t *heap, void *p, size_t oldcount, size_t newcount, size_t size, size_t alignment) |
| As mi_recalloc_aligned() but allocates in a specific heap. | |
| void * | mi_heap_recalloc_aligned_at (mi_heap_t *heap, void *p, size_t oldcount, size_t newcount, size_t size, size_t alignment, size_t offset) |
| As mi_recalloc_aligned_at() but allocates in a specific heap. | |
Re-allocation where the expanded part is initialized to zero.
Note: the previous versions of these functions did not take the old size (or count) and could only be used on memory that was originally allocated with zero initialization (e.g. mi_calloc, mi_zalloc, etc.). These deprecated functions can still be called by putting parentheses around the function name, e.g. (mi_rezalloc)(p,newsize).
The re-allocated block preserves the first min(oldsize,newsize) bytes of p, and the rest of the block is initialized to zero (up to its usable size). The block p does not need to be zero initialized, and the old size is clamped to the usable size of p (see mi_usable_size()).
| void * mi_heap_recalloc | ( | mi_heap_t * | heap, |
| void * | p, | ||
| size_t | oldcount, | ||
| size_t | newcount, | ||
| size_t | size ) |
As mi_recalloc() but allocates in a specific heap.
| void * mi_heap_recalloc_aligned | ( | mi_heap_t * | heap, |
| void * | p, | ||
| size_t | oldcount, | ||
| size_t | newcount, | ||
| size_t | size, | ||
| size_t | alignment ) |
As mi_recalloc_aligned() but allocates in a specific heap.
| void * mi_heap_recalloc_aligned_at | ( | mi_heap_t * | heap, |
| void * | p, | ||
| size_t | oldcount, | ||
| size_t | newcount, | ||
| size_t | size, | ||
| size_t | alignment, | ||
| size_t | offset ) |
As mi_recalloc_aligned_at() but allocates in a specific heap.
| void * mi_heap_rezalloc | ( | mi_heap_t * | heap, |
| void * | p, | ||
| size_t | oldsize, | ||
| size_t | newsize ) |
As mi_rezalloc() but allocates in a specific heap.
| void * mi_heap_rezalloc_aligned | ( | mi_heap_t * | heap, |
| void * | p, | ||
| size_t | oldsize, | ||
| size_t | newsize, | ||
| size_t | alignment ) |
As mi_rezalloc_aligned() but allocates in a specific heap.
| void * mi_heap_rezalloc_aligned_at | ( | mi_heap_t * | heap, |
| void * | p, | ||
| size_t | oldsize, | ||
| size_t | newsize, | ||
| size_t | alignment, | ||
| size_t | offset ) |
As mi_rezalloc_aligned_at() but allocates in a specific heap.
| void * mi_recalloc | ( | void * | p, |
| size_t | oldcount, | ||
| size_t | newcount, | ||
| size_t | size ) |
Re-allocate memory to newcount elements of size bytes, with the elements from oldcount initialized to zero.
| p | Pointer to a previously allocated block (or NULL). |
| oldcount | The old number of elements in p (ignored if p is NULL). |
| newcount | The new number of elements. |
| size | The size of each element. |
If there is no overflow, it behaves exactly like mi_rezalloc(p,oldcount*size,newcount*size).
| void * mi_recalloc_aligned | ( | void * | p, |
| size_t | oldcount, | ||
| size_t | newcount, | ||
| size_t | size, | ||
| size_t | alignment ) |
As mi_recalloc() but the returned block is aligned to alignment.
| void * mi_recalloc_aligned_at | ( | void * | p, |
| size_t | oldcount, | ||
| size_t | newcount, | ||
| size_t | size, | ||
| size_t | alignment, | ||
| size_t | offset ) |
As mi_recalloc() but the returned block is aligned by alignment at a specified offset.
| void * mi_rezalloc | ( | void * | p, |
| size_t | oldsize, | ||
| size_t | newsize ) |
Re-allocate memory to newsize bytes, with the memory from oldsize initialized to zero.
| p | Pointer to a previously allocated block (or NULL). |
| oldsize | The old size of p (ignored if p is NULL). |
| newsize | The new size in bytes. |
If p is NULL, it behaves as mi_zalloc(newsize).
| void * mi_rezalloc_aligned | ( | void * | p, |
| size_t | oldsize, | ||
| size_t | newsize, | ||
| size_t | alignment ) |
As mi_rezalloc() but the returned block is aligned to alignment.
| void * mi_rezalloc_aligned_at | ( | void * | p, |
| size_t | oldsize, | ||
| size_t | newsize, | ||
| size_t | alignment, | ||
| size_t | offset ) |
As mi_rezalloc() but the returned block is aligned by alignment at a specified offset.