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
voidtype 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
chartype. - 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
errnovalue of the error inerr. - 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_ttype.