|new 0.2.18||Jul 30, 2020|
|0.2.16||Jun 28, 2020|
|0.2.8||Mar 21, 2020|
#68 in Memory management
3,573 downloads per month
Used in 2 crates (via snmalloc-rs)
Notice: MinGW Build is broken and may not be fixed in a near future. See this PR in the upstream.
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:
- Memory that is freed by the same thread that allocated it does not require any synchronising operations.
- Freeing memory in a different thread to initially allocated it, does not take any locks and instead uses a novel message passing scheme to return the memory to the original allocator, where it is recycled.
- The allocator uses large ranges of pages to reduce the amount of meta-data required.
debug: Enable the
1mib: Use the
1mibchunk configuration. From
0.2.17, this is set as a default feature
16mib: Use the
cache-friendly: Make the allocator more cache friendly (setting
64in building the library).
snmallocfor the native CPU of the host machine. (this is not a default behavior since
madviseproblem of QEMU environment
stats: enable statistics
To get the crates compiled, you need to choose either
16mib to determine the chunk configuration
snmalloc-rs add it as a dependency:
# Cargo.toml [dependencies] snmalloc-rs = "0.2"
SnMalloc as the global allocator add this to your project:
#[global_allocator] static ALLOC: snmalloc_rs::SnMalloc = snmalloc_rs::SnMalloc;
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
Notice: since version
0.2.12, we no longer require you to provide additional environment variables for
ANDROID_NDKmust be provided as an environment variable
ANDROID_PLATFORMcan be passed as an optional environment variable
ANDROID_ABIused by CMake is detected automatically
android-lldcan be used to set the linker of
android-shared-stdcan be used to set the STL library of
- upstream add backoff for large reservation
- upstream default chunk configuration to 1mib
- add new feature flags
- upstream New implementation of address space reservation leading to
- better integration with transparent huge pages; and
- lower address space requirements and fragmentation.
- Notice MinGW broken state
- upstream fix VS2019 build
- upstream fix wrong realloc behavior and performance issue
for older versions, see CHANGELOG