Skip to main content

Crate cyo_mimalloc_sys

Crate cyo_mimalloc_sys 

Source
Expand description

Low-level FFI bindings to mimalloc v3.

The build script compiles the bundled mimalloc sources into a static library and links it. For a safe wrapper and the global allocator, use the cyo-mimalloc crate.

Each function has the name and the signature of its declaration in mimalloc.h or mimalloc-profile.h, and those headers document it. mi_option_t documents every runtime option and how to set it.

Structs§

mi_heap_area_t
An area of a heap that holds blocks of a single size.
mi_heap_t
A mimalloc heap.
mi_profiler_sample_data_t
The profiler data that mimalloc stores with a sampled allocation.
mi_profiler_t
A table of profiling callbacks. mimalloc’s profiling support is experimental.
mi_subproc_id_t
The identifier of a mimalloc subprocess.

Enums§

c_void
Equivalent to C’s void type when used as a pointer.
mi_option_t
A mimalloc runtime option.

Constants§

MI_PROFILE_SAMPLE_DATA_MAX_SIZE
The largest number of bytes of profiler data that mimalloc stores with a sampled allocation.

Functions§

mi_arena_max_object_size⚠
mi_arena_min_alignment⚠
mi_arena_min_size⚠
mi_calloc⚠
mi_calloc_aligned⚠
mi_collect⚠
mi_free⚠
mi_free_size⚠
mi_free_small⚠
mi_free_small_nonnull⚠
mi_good_size⚠
mi_heap_calloc⚠
mi_heap_collect⚠
mi_heap_contains⚠
mi_heap_delete⚠
mi_heap_destroy⚠
mi_heap_main⚠
mi_heap_malloc⚠
mi_heap_malloc_aligned⚠
mi_heap_new⚠
mi_heap_new_in_arena⚠
mi_heap_of⚠
mi_heap_profile⚠
mi_heap_profile_disable⚠
mi_heap_realloc⚠
mi_heap_stats_get_json⚠
mi_heap_stats_print_out⚠
mi_heap_zalloc⚠
mi_malloc⚠
mi_malloc_aligned⚠
mi_malloc_size⚠
mi_malloc_small⚠
mi_malloc_usable_size⚠
mi_mallocn⚠
mi_manage_os_memory_ex⚠
mi_memalign⚠
mi_option_disable⚠
mi_option_enable⚠
mi_option_get⚠
mi_option_get_size⚠
mi_option_is_enabled⚠
mi_option_set⚠
mi_posix_memalign⚠
mi_process_info⚠
mi_process_info_print_out⚠
mi_profile⚠
mi_profiler_start⚠
mi_profiler_stop⚠
mi_realloc⚠
mi_realloc_aligned⚠
mi_reallocn⚠
mi_reserve_huge_os_pages_at⚠
mi_reserve_huge_os_pages_interleave⚠
mi_reserve_os_memory_ex⚠
mi_stats_get_json⚠
mi_stats_print_out⚠
mi_stats_reset⚠
mi_strdup⚠
mi_subproc_profile⚠
mi_thread_set_in_threadpool⚠
mi_usable_size⚠
mi_version⚠
mi_wmalloc_small⚠
mi_wzalloc_small⚠
mi_zalloc⚠
mi_zalloc_aligned⚠
mi_zalloc_small⚠

Type Aliases§

c_char
Equivalent to C’s char type.
c_int
Equivalent to C’s signed int (int) type.
c_long
Equivalent to C’s signed long (long) type.
mi_arena_id_t
The identifier of an arena.
mi_block_visit_fun
A function that mimalloc calls for each area of a heap, and for each block when you ask it to visit blocks.
mi_deferred_free_fun
A function that mimalloc calls regularly, so that you can free memory that you deferred freeing.
mi_error_fun
A function that mimalloc calls when an error occurs, with the errno value of the error in err.
mi_heap_visit_fun
A function that mimalloc calls for each heap of a subprocess.
mi_output_fun
A function that receives mimalloc’s text output.
mi_profiler_on_alloc_fun
A function that mimalloc calls on each sampled allocation.
mi_profiler_on_free_fun
A function that mimalloc calls when a sampled allocation is freed.
mi_profiler_on_realloc_inplace_fun
A function that mimalloc calls when it reallocates a sampled allocation in place.
size_t
The C size_t type.