7 releases

✓ Uses Rust 2018 edition

new 0.1.15 Feb 12, 2020
0.1.14 Feb 12, 2020
0.1.12 Jan 31, 2020
0.1.11 Dec 7, 2019
0.1.3 Jun 26, 2019

#24 in Memory management

Download history 313/week @ 2019-11-01 176/week @ 2019-11-08 90/week @ 2019-11-15 152/week @ 2019-11-22 92/week @ 2019-11-29 257/week @ 2019-12-06 266/week @ 2019-12-13 40/week @ 2019-12-20 59/week @ 2019-12-27 159/week @ 2020-01-03 479/week @ 2020-01-10 412/week @ 2020-01-17 305/week @ 2020-01-24 386/week @ 2020-01-31 398/week @ 2020-02-07

1,009 downloads per month
Used in pgc

MIT license

775KB
12K SLoC

C 7K SLoC // 0.2% comments JavaScript 2K SLoC // 0.1% comments Visual Studio Project 2K SLoC Rust 181 SLoC // 0.2% comments Visual Studio Solution 151 SLoC C++ 67 SLoC // 0.1% comments

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

CMake and a C compiler are 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 should only be around 3% according to mimalloc own benchmarks.

To disable secure mode, put in Cargo.toml:

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

Usage with full secure mode

From version 1.2.0, mimalloc exposes another layer of secure features named full-secure mode that adds double-free mitigation. However, this might result in a bigger runtime performance hit than using only the plain secure mode.

To run mimalloc in full-secure mode, put in Cargo.toml:

[dependencies]
mimalloc = { version = "*", features = "secure-full" }

Dependencies