31 releases

0.1.41 Apr 22, 2024
0.1.39 Sep 14, 2023
0.1.37 Apr 25, 2023
0.1.34 Jan 7, 2023
0.1.5 Jul 2, 2019

#10 in Memory management

Download history 55464/week @ 2024-01-14 62485/week @ 2024-01-21 56798/week @ 2024-01-28 59827/week @ 2024-02-04 60365/week @ 2024-02-11 60891/week @ 2024-02-18 68320/week @ 2024-02-25 65365/week @ 2024-03-03 67383/week @ 2024-03-10 69720/week @ 2024-03-17 67229/week @ 2024-03-24 69248/week @ 2024-03-31 72164/week @ 2024-04-07 75661/week @ 2024-04-14 85103/week @ 2024-04-21 75992/week @ 2024-04-28

314,647 downloads per month
Used in 192 crates (169 directly)

MIT license

540KB
9K SLoC

C 9K SLoC // 0.2% comments Rust 468 SLoC // 0.0% comments

Mimalloc Rust

Latest Version Documentation

A drop-in global allocator wrapper around the mimalloc allocator. Mimalloc is a general purpose, performance oriented allocator built by Microsoft.

Usage

use mimalloc::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 = { version = "*", features = ["secure"] }

Dependencies