| Crates.io | memapi-mimalloc-sys |
| lib.rs | memapi-mimalloc-sys |
| version | 0.1.3+3.1.5-1-g09a27098aa6e9286518bd9c74e6ffa7199c3f04e |
| created_at | 2025-08-03 18:19:09.770409+00 |
| updated_at | 2025-08-10 16:06:58.257146+00 |
| description | FFI bindings to MiMalloc made for memapi. |
| homepage | |
| repository | https://github.com/echohumm/mimalloc_rust |
| max_upload_size | |
| id | 1779943 |
| size | 946,782 |
A drop-in global allocator wrapper around the mimalloc allocator. Mimalloc is a general purpose, performance oriented allocator built by Microsoft.
use mimalloc::MiMalloc;
#[global_allocator]
static GLOBAL: MiMalloc = MiMalloc;
A C compiler is required for building mimalloc with cargo.
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 = { version = "*", features = ["secure"] }