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;
static GLOBAL: MiMalloc = MiMalloc;
Requirements
CMake and a C compiler are required for building mimalloc with cargo.
Usage without secure mode
By default this library builds mimalloc in secure mode. This add guard pages, randomized allocation, encrypted free lists, etc. The performance penalty should only be around 3% according to mimalloc own benchmarks.
To disable secure mode, put in Cargo.toml
:
=
mimalloc
Usage with full secure mode
From version 1.2.0, mimalloc exposes another layer of secure features named full-secure mode
that adds double-free mitigation. However, this might result in a bigger runtime performance hit than using only the plain secure mode.
To run mimalloc in full-secure mode, put in Cargo.toml
:
=
mimalloc