baby-mimalloc
Mimalloc implemented in Rust (not a binding to the C library) with only basic features.
Lock-free multi-threading, security features, and some performance enhancements are not implemented.
It can be used in no_std environments.
Features
- mmap - Provide
MimallocMmapthat usesmmapas OS allocator for segments. - std_mutex - Provide
MimallocMutexWrapperthat wrapsMimallocinsidestd::sync::Mutexand implementsGlobalAlloc. - spin_mutex - Provide
MimallocMutexWrapperthat wrapsMimallocinsidespin::Mutexthat can be used inno_stdenvironments.
Usage
[]
= { = "*", = ["mmap", "std_mutex"] }
# baby-mimalloc = { version = "*", features = ["mmap", "spin_mutex"] }
use ;
static ALLOCATOR: MimallocMmapMutex = new_mimalloc_mmap_mutex;