Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/purpleprotocol/mimalloc_rust
A Rust wrapper over Microsoft's MiMalloc memory allocator
https://github.com/purpleprotocol/mimalloc_rust
allocator mimalloc rust
Last synced: 27 days ago
JSON representation
A Rust wrapper over Microsoft's MiMalloc memory allocator
- Host: GitHub
- URL: https://github.com/purpleprotocol/mimalloc_rust
- Owner: purpleprotocol
- License: mit
- Created: 2019-06-24T12:22:49.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-09-02T12:56:08.000Z (2 months ago)
- Last Synced: 2024-10-01T17:08:23.188Z (about 1 month ago)
- Topics: allocator, mimalloc, rust
- Language: Rust
- Homepage:
- Size: 164 KB
- Stars: 506
- Watchers: 8
- Forks: 42
- Open Issues: 27
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Mimalloc Rust
[![Latest Version]][crates.io] [![Documentation]][docs.rs]
A drop-in global allocator wrapper around the [mimalloc](https://github.com/microsoft/mimalloc) allocator.
Mimalloc is a general purpose, performance oriented allocator built by Microsoft.## Usage
```rust
use mimalloc::MiMalloc;#[global_allocator]
static GLOBAL: MiMalloc = MiMalloc;
```## Requirements
A __C__ compiler is required for building [mimalloc](https://github.com/microsoft/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](https://github.com/microsoft/mimalloc)
own benchmarks.To enable secure mode, put in `Cargo.toml`:
```ini
[dependencies]
mimalloc = { version = "*", features = ["secure"] }
```[crates.io]: https://crates.io/crates/mimalloc
[Latest Version]: https://img.shields.io/crates/v/mimalloc.svg
[Documentation]: https://docs.rs/mimalloc/badge.svg
[docs.rs]: https://docs.rs/mimalloc