30 releases

0.1.39 Sep 14, 2023
0.1.37 Apr 25, 2023
0.1.34 Jan 7, 2023
0.1.32 Nov 15, 2022
0.1.5 Jul 2, 2019

#10 in Memory management

Download history 38384/week @ 2023-12-23 48550/week @ 2023-12-30 57917/week @ 2024-01-06 55466/week @ 2024-01-13 62097/week @ 2024-01-20 57705/week @ 2024-01-27 59333/week @ 2024-02-03 60500/week @ 2024-02-10 61224/week @ 2024-02-17 66393/week @ 2024-02-24 66236/week @ 2024-03-02 67385/week @ 2024-03-09 68898/week @ 2024-03-16 68189/week @ 2024-03-23 68603/week @ 2024-03-30 61062/week @ 2024-04-06

276,975 downloads per month
Used in 187 crates (165 directly)

MIT license

510KB
9K SLoC

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