Function libmimalloc_sys::mi_reserve_os_memory_ex
source · pub unsafe extern "C" fn mi_reserve_os_memory_ex(
size: usize,
commit: bool,
allow_large: bool,
exclusive: bool,
arena_id: *mut mi_arena_id_t
) -> c_intExpand description
Reserve OS memory for use by mimalloc. Reserved areas are used
before allocating from the OS again. By reserving a large area upfront,
allocation can be more efficient, and can be better managed on systems
without mmap/VirtualAlloc (like WASM for example).
sizeThe size to reserve.commitCommit the memory upfront.allow_largeAllow large OS pages (2MiB) to be used?exclusiveOnly allow allocations if specifically for this arena.arena_idPointer who’s value will be set to the new arena_id if successful.
Returns 0 if successful, and an error code otherwise (e.g. ENOMEM)