|
| void * | mi_malloc_aligned (size_t size, size_t alignment) |
| | Allocate size bytes aligned by alignment.
|
| void * | mi_zalloc_aligned (size_t size, size_t alignment) |
| void * | mi_calloc_aligned (size_t count, size_t size, size_t alignment) |
| void * | mi_realloc_aligned (void *p, size_t newsize, size_t alignment) |
| void * | mi_malloc_aligned_at (size_t size, size_t alignment, size_t offset) |
| | Allocate size bytes aligned by alignment at a specified offset.
|
| void * | mi_zalloc_aligned_at (size_t size, size_t alignment, size_t offset) |
| void * | mi_calloc_aligned_at (size_t count, size_t size, size_t alignment, size_t offset) |
| void * | mi_realloc_aligned_at (void *p, size_t newsize, size_t alignment, size_t offset) |
Allocating aligned memory blocks.
Note that alignment always follows size for consistency with the unaligned allocation API, but unfortunately this differs from posix_memalign and aligned_alloc in the C library.
Aligned and unaligned functions can be freely mixed: any pointer returned by mimalloc can be passed to mi_realloc_aligned (and mi_realloc_aligned_at) with any alignment (and offset), larger or smaller than the one it was originally allocated with. Similarly, pointers from the aligned API can be passed to mi_free, mi_realloc, mi_usable_size, etc.