Function libmimalloc_sys::mi_manage_os_memory_ex
source · pub unsafe extern "C" fn mi_manage_os_memory_ex(
start: *const c_void,
size: usize,
is_committed: bool,
is_large: bool,
is_zero: bool,
numa_node: c_int,
exclusive: bool,
arena_id: *mut mi_arena_id_t
) -> boolExpand description
Manage a particular memory area for use by mimalloc.
This is just like mi_reserve_os_memory_ex except that the area should already be
allocated in some manner and available for use my mimalloc.
§Safety
mimalloc will likely segfault when allocating from the arena if the arena start & size
aren’t aligned with mimalloc’s MI_SEGMENT_ALIGN (e.g. 32MB on x86_64 machines).
startStart of the memory areasizeThe size of the memory area. Must be large thanMI_ARENA_BLOCK_SIZE(e.g. 64MB on x86_64 machines).commitSet true if the memory range is already commited.is_largeSet true if the memory range consists of large files, or if the memory should not be decommitted or protected (like rdma etc.).is_zeroSet true if the memory range consists only of zeros.numa_nodePossible associated numa node or-1.exclusiveOnly allow allocations if specifically for this arena.arena_idPointer who’s value will be set to the new arena_id if successful.
Returns true if arena was successfully allocated