8 releases

new 0.1.47 Apr 24, 2025
0.1.46 Apr 4, 2025
0.1.45 Mar 16, 2025

#833 in Memory management

Download history 271/week @ 2025-03-05 2060/week @ 2025-03-12 3503/week @ 2025-03-19 2332/week @ 2025-03-26 2980/week @ 2025-04-02 1717/week @ 2025-04-09 2321/week @ 2025-04-16

9,777 downloads per month
Used in 4 crates (via mimalloc-safe)

MIT license

605KB
10K SLoC

C 10K SLoC // 0.2% comments Rust 437 SLoC // 0.0% comments

mimalloc-safe

Forked from https://github.com/purpleprotocol/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_safe::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-safe = { version = "*", features = ["secure"] }

Dependencies