4 releases

0.2.3 Mar 4, 2025
0.2.3-alpha.1 Mar 3, 2025
0.2.2 Mar 3, 2025

#452 in Memory management

Download history 309/week @ 2025-02-28 189/week @ 2025-03-07 188/week @ 2025-03-14

686 downloads per month
Used in mimalloc-rspack

MIT license

1MB
20K SLoC

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