https://github.com/brson/megamalloc
https://github.com/brson/megamalloc
Last synced: 10 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/brson/megamalloc
- Owner: brson
- Created: 2019-04-01T18:05:38.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2019-06-10T18:30:31.000Z (about 7 years ago)
- Last Synced: 2024-12-15T17:51:16.470Z (over 1 year ago)
- Language: Rust
- Size: 8.79 KB
- Stars: 6
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
The megamalloc crate packages up all the Rust allocator crates,
exposing their metrics through a consistent interface,
providing tools to compare performance and tweak configurations.
It supports the following features:
- global - Define the global allocator (default)
- system_alloc - Use the system allocator (default)
- jemalloc - Use jemalloc
- ralloc - Use ralloc
- tcmalloc - Use tcmalloc
The megamalloc global allocator wraps the global allocator of
whichever implementation is selected, and provides additional methods.
```rust
/// Returns a string uniquely naming the allocator
pub fn name(&self) -> &'static str;
/// Returns allocator-dependent metrics as a `Vec` of `(str, usize)`
pub fn fetch_stats(&self) -> Result>;
```
Metrics are implemented for glibc malloc (the system allocator on most
linux targets), jemalloc, and tcmalloc.
That's all for now. More in the future.