SchrodingerZhu / snmalloc-rs

rust bindings of snmalloc
MIT License
122 stars 16 forks source link

snmalloc-rs

Notice: MinGW Build is broken and may not be fixed in a near future. See this PR in the upstream.

MSVC/MinGW/Linux/MacOS: Actions Status

FreeBSD: Build Status

snmalloc-rs provides a wrapper for microsoft/snmalloc to make it usable as a global allocator for rust. snmalloc is a research allocator. Its key design features are:

Some old benchmark results are available in the snmalloc paper. Some recent benchmark results are listed at bench_suite. There are three features defined in this crate:

To get the crates compiled, you need to choose either 1mib or 16mib to determine the chunk configuration

To use snmalloc-rs add it as a dependency:

# Cargo.toml
[dependencies]
snmalloc-rs = "0.3.4"

To set SnMalloc as the global allocator add this to your project:

#[global_allocator]
static ALLOC: snmalloc_rs::SnMalloc = snmalloc_rs::SnMalloc;

For MinGW Users

mingw version is only tested on nightly branch with MSYS environment. We are using dynamic linking method. Hence, please make sure the following libs are in your PATH:

Notice: since version 0.2.12, we no longer require you to provide additional environment variables for mingw target.

For Android Cross-Compilation

Changelog

0.3.4

0.3.3

0.3.2

0.3.1

0.3.0

0.3.0-beta.1