Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ljedrz/system_alloc_stats
https://github.com/ljedrz/system_alloc_stats
Last synced: 25 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/ljedrz/system_alloc_stats
- Owner: ljedrz
- License: cc0-1.0
- Created: 2023-08-09T14:43:04.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-06-23T13:04:28.000Z (5 months ago)
- Last Synced: 2024-10-12T13:17:30.357Z (about 1 month ago)
- Language: Rust
- Size: 16.6 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# system_alloc_stats
[![crates.io](https://img.shields.io/crates/v/system_alloc_stats)](https://crates.io/crates/system_alloc_stats)
[![docs.rs](https://docs.rs/system_alloc_stats/badge.svg)](https://docs.rs/system_alloc_stats)
[![actively maintained](https://img.shields.io/badge/Maintenance%20Level-Actively%20Maintained-green.svg)](https://gist.github.com/cheerfulstoic/d107229326a01ff0f333a1d3476e068d)**system_alloc_stats** provides a wrapper around the [`System`](https://doc.rust-lang.org/std/alloc/struct.System.html) allocator, exposing some of its runtime statistics.
## Usage
```rust
use system_alloc_stats::SystemWithStats;#[global_allocator]
static SWS: SystemWithStats = SystemWithStats;fn main() {
(...)
println!("current heap use: {}; average allocation size: {}", SWS.use_curr(), SWS.alloc_avg());
(...)
}
```