8 releases
new 0.1.47 | Apr 24, 2025 |
---|---|
0.1.46 | Apr 4, 2025 |
0.1.45 | Mar 16, 2025 |
#833 in Memory management
9,777 downloads per month
Used in 4 crates
(via mimalloc-safe)
605KB
10K
SLoC
mimalloc-safe
Forked from https://github.com/purpleprotocol/mimalloc_rust
A drop-in global allocator wrapper around the mimalloc allocator. Mimalloc is a general purpose, performance oriented allocator built by Microsoft.
Usage
use mimalloc_safe::MiMalloc;
#[global_allocator]
static GLOBAL: MiMalloc = MiMalloc;
Requirements
A C compiler is required for building mimalloc with cargo.
Usage with secure mode
Using secure mode adds guard pages, randomized allocation, encrypted free lists, etc. The performance penalty is usually around 10% according to mimalloc own benchmarks.
To enable secure mode, put in Cargo.toml
:
[dependencies]
mimalloc-safe = { version = "*", features = ["secure"] }