38 releases

0.1.40 Mar 18, 2025
0.1.39 Jun 23, 2024
0.1.38 May 20, 2024
0.1.35 Sep 14, 2023
0.1.4 Jul 2, 2019

#297 in Memory management

Download history 118103/week @ 2024-12-05 121816/week @ 2024-12-12 80263/week @ 2024-12-19 78819/week @ 2024-12-26 106332/week @ 2025-01-02 134325/week @ 2025-01-09 129971/week @ 2025-01-16 132414/week @ 2025-01-23 141967/week @ 2025-01-30 153629/week @ 2025-02-06 143299/week @ 2025-02-13 183380/week @ 2025-02-20 180201/week @ 2025-02-27 189368/week @ 2025-03-06 202469/week @ 2025-03-13 173650/week @ 2025-03-20

775,410 downloads per month
Used in 323 crates (8 directly)

MIT license

595KB
10K SLoC

C 10K SLoC // 0.2% comments Rust 378 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