https://github.com/ljedrz/system_alloc_stats
https://github.com/ljedrz/system_alloc_stats
Last synced: 3 months 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 (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2024-06-23T13:04:28.000Z (11 months ago)
- Last Synced: 2024-10-12T13:17:30.357Z (8 months 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
[](https://crates.io/crates/system_alloc_stats)
[](https://docs.rs/system_alloc_stats)
[](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());
(...)
}
```