v3: Allocate or free memory while reporting the usable size in bytes. More...
Functions | |
| void * | mi_umalloc (size_t size, size_t *pusable_size) |
| Allocate size bytes and report the usable size through pusable_size. | |
| void * | mi_uzalloc (size_t size, size_t *pusable_size) |
| Allocate size zero-initialized bytes and report the usable size through pusable_size. | |
| void * | mi_ucalloc (size_t count, size_t size, size_t *pusable_size) |
| Allocate count zero-initialized elements of size bytes and report the usable size. | |
| void * | mi_urealloc (void *p, size_t newsize, size_t *pusable_size_pre, size_t *pusable_size_post) |
| Reallocate p to newsize bytes and report the old and new usable sizes. | |
| void | mi_ufree (void *p, size_t *pusable_size) |
| Free p and report its usable size, or 0 if p is NULL. | |
| void * | mi_umalloc_aligned (size_t size, size_t alignment, size_t *pusable_size) |
| As mi_malloc_aligned(), additionally reporting the usable size on success. | |
| void * | mi_uzalloc_aligned (size_t size, size_t alignment, size_t *pusable_size) |
| As mi_zalloc_aligned(), additionally reporting the usable size on success. | |
| void * | mi_urealloc_aligned (void *p, size_t newsize, size_t alignment, size_t *pusable_size_pre, size_t *pusable_size_post) |
| As mi_realloc_aligned(), additionally reporting the old and new usable sizes (as mi_urealloc()). | |
| void * | mi_umalloc_small (size_t size, size_t *pusable_size) |
| As mi_malloc_small(), additionally reporting the usable size on success. | |
| void * | mi_uzalloc_small (size_t size, size_t *pusable_size) |
| As mi_zalloc_small(), additionally reporting the usable size on success. | |
v3: Allocate or free memory while reporting the usable size in bytes.
The reported size always equals mi_usable_size() of the returned (or freed) pointer, and can be used as the writable capacity. Size output pointers may be NULL. Allocation size outputs are only valid on success; they need not be cleared on failure.
| void * mi_ucalloc | ( | size_t | count, |
| size_t | size, | ||
| size_t * | pusable_size ) |
Allocate count zero-initialized elements of size bytes and report the usable size.
| void mi_ufree | ( | void * | p, |
| size_t * | pusable_size ) |
Free p and report its usable size, or 0 if p is NULL.
| void * mi_umalloc | ( | size_t | size, |
| size_t * | pusable_size ) |
Allocate size bytes and report the usable size through pusable_size.
| void * mi_umalloc_aligned | ( | size_t | size, |
| size_t | alignment, | ||
| size_t * | pusable_size ) |
As mi_malloc_aligned(), additionally reporting the usable size on success.
| void * mi_umalloc_small | ( | size_t | size, |
| size_t * | pusable_size ) |
As mi_malloc_small(), additionally reporting the usable size on success.
size must not exceed MI_SMALL_SIZE_MAX.
| void * mi_urealloc | ( | void * | p, |
| size_t | newsize, | ||
| size_t * | pusable_size_pre, | ||
| size_t * | pusable_size_post ) |
Reallocate p to newsize bytes and report the old and new usable sizes.
pusable_size_pre is 0 for NULL input; pusable_size_post is valid on success.
| void * mi_urealloc_aligned | ( | void * | p, |
| size_t | newsize, | ||
| size_t | alignment, | ||
| size_t * | pusable_size_pre, | ||
| size_t * | pusable_size_post ) |
As mi_realloc_aligned(), additionally reporting the old and new usable sizes (as mi_urealloc()).
| void * mi_uzalloc | ( | size_t | size, |
| size_t * | pusable_size ) |
Allocate size zero-initialized bytes and report the usable size through pusable_size.
| void * mi_uzalloc_aligned | ( | size_t | size, |
| size_t | alignment, | ||
| size_t * | pusable_size ) |
As mi_zalloc_aligned(), additionally reporting the usable size on success.
| void * mi_uzalloc_small | ( | size_t | size, |
| size_t * | pusable_size ) |
As mi_zalloc_small(), additionally reporting the usable size on success.
size must not exceed MI_SMALL_SIZE_MAX.