25 releases

0.1.34 Jan 7, 2023
0.1.32 Nov 15, 2022
0.1.29 Apr 30, 2022
0.1.28 Feb 15, 2022
0.1.5 Jul 2, 2019

#7 in Memory management

Download history 25987/week @ 2022-10-18 31085/week @ 2022-10-25 36459/week @ 2022-11-01 40313/week @ 2022-11-08 29781/week @ 2022-11-15 26044/week @ 2022-11-22 28375/week @ 2022-11-29 25786/week @ 2022-12-06 25835/week @ 2022-12-13 21279/week @ 2022-12-20 18211/week @ 2022-12-27 30574/week @ 2023-01-03 28580/week @ 2023-01-10 31069/week @ 2023-01-17 31361/week @ 2023-01-24 26119/week @ 2023-01-31

123,495 downloads per month
Used in 100 crates (94 directly)

MIT license

1MB
16K SLoC

C 9K SLoC // 0.2% comments Visual Studio Project 3.5K SLoC JavaScript 2.5K SLoC // 0.1% comments Rust 472 SLoC // 0.1% comments C++ 263 SLoC // 0.1% comments Visual Studio Solution 232 SLoC

Mimalloc Rust

Build Status 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 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 is usually around 10% according to mimalloc own benchmarks.

To disable secure mode, put in Cargo.toml:

[dependencies]
mimalloc = { version = "*", default-features = false }

Dependencies