4 releases
| 0.2.1 | Dec 18, 2024 |
|---|---|
| 0.2.0 | Dec 9, 2024 |
| 0.1.1 | Dec 9, 2024 |
| 0.1.0 | Dec 9, 2024 |
#603 in Memory management
1,144 downloads per month
Used in libafl_asan
47KB
1K
SLoC
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.
Crate 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. - deferred_free - Enable registering a hook to complete deferred free events. See the documentation of
mi_register_deferred_free.
Usage
[dependencies]
baby-mimalloc = { version = "*", features = ["mmap", "std_mutex"] }
# baby-mimalloc = { version = "*", features = ["mmap", "spin_mutex"] }
use baby_mimalloc::{new_mimalloc_mmap_mutex, MimallocMmapMutex};
#[global_allocator]
static ALLOCATOR: MimallocMmapMutex = new_mimalloc_mmap_mutex();
Dependencies
~49KB