Module allocator

Source

Functions§

mi_aligned_alloc
Allocate size bytes aligned by alignment with alignment as the first parameter.
mi_calloc
Allocate count items of size length each.
mi_calloc_aligned
Allocate size * count bytes aligned by alignment.
mi_calloc_aligned_at
Allocate size * count bytes aligned by alignment at a specified offset, zero-initialized.
mi_cfree
Checked free: If p came from mimalloc’s heap (as decided by mi_is_in_heap_region), this is [mi_free(p)], but otherwise it is a no-op.
mi_collect
Eagerly free memory.
mi_expand
Try to re-allocate memory to newsize bytes in place.
mi_free
Free previously allocated memory.
mi_free_aligned
Alignment-aware deallocation: Like mi_free, but accepts the size and alignment as well.
mi_free_size
Size-aware deallocation: Like mi_free, but accepts the size and alignment as well.
mi_free_size_aligned
Layout-aware deallocation: Like mi_free, but accepts the size and alignment as well.
mi_good_size
Return the used allocation size.
mi_is_in_heap_region
Returns true if this is a pointer into a memory region that has been reserved by the mimalloc heap.
mi_malloc
Allocate size bytes.
mi_malloc_aligned
Allocate size bytes aligned by alignment.
mi_malloc_aligned_at
Allocate size bytes aligned by alignment at a specified offset.
mi_malloc_small
Allocate an object of no more than MI_SMALL_SIZE_MAX bytes.
mi_mallocn
Allocate count items of size length each.
mi_posix_memalign
Allocate size of bytes aligned by alignment and place the address of the allocated memory to ptr.
mi_process_info
Return process information (time and memory usage). All parameters are optional (nullable) out-params:
mi_process_init
Initialize the process.
mi_realloc
Re-allocate memory to newsize bytes.
mi_realloc_aligned
Re-allocate memory to newsize bytes, aligned by alignment.
mi_realloc_aligned_at
Re-allocate memory to newsize bytes aligned by alignment at a specified offset.
mi_reallocf
Re-allocate memory to newsize bytes.
mi_reallocn
Re-allocate memory to count elements of size bytes.
mi_realpath
Resolve a file path name, producing a C string which can be passed to mi_free.
mi_recalloc
Zero initialized re-allocation, following calloc paramater conventions.
mi_recalloc_aligned
Aligned version of mi_recalloc.
mi_recalloc_aligned_at
Offset-aligned version of mi_recalloc.
mi_register_deferred_free
Register a deferred free function.
mi_register_error
Register an error callback function.
mi_register_output
Register an output function.
mi_rezalloc
Zero initialized re-allocation.
mi_rezalloc_aligned
Aligned version of mi_rezalloc.
mi_rezalloc_aligned_at
Offset-aligned version of mi_rezalloc.
mi_stats_merge
Merge thread local statistics with the main statistics and reset.
mi_stats_print
Print the main statistics.
mi_stats_print_out
Print the main statistics.
mi_stats_reset
Reset statistics.
mi_strdup
Allocate and duplicate a nul-terminated C string.
mi_strndup
Allocate and duplicate a nul-terminated C string, up to n bytes.
mi_thread_done
Uninitialize mimalloc on a thread.
mi_thread_init
Initialize mimalloc on a thread.
mi_thread_stats_print_out
Print out heap statistics for this thread.
mi_usable_size
Return the available bytes in a memory block.
mi_version
Return the mimalloc version number.
mi_zalloc
Allocate zero-initialized size bytes.
mi_zalloc_aligned
Allocate size bytes aligned by alignment, initialized to zero.
mi_zalloc_aligned_at
Allocate size bytes aligned by alignment at a specified offset, zero-initialized.
mi_zalloc_small
Allocate an zero-initialized object of no more than MI_SMALL_SIZE_MAX bytes.