stats_alloc

An instrumenting middleware for global allocators in Rust, useful in testing for validating assumptions regarding allocation patterns, and potentially in production loads to monitor for memory leaks.

Example

```rust extern crate stats_alloc;

use stats_alloc::{StatsAlloc, Region}; use std::alloc::System;

[global_allocator]

static STATS_ALLOC: StatsAlloc = StatsAlloc::system();

fn exampleusingregion() { let reg = Region::new(&STATSALLOC); let x: Vec = Vec::withcapacity(1024); println!("Stats at 1: {:#?}", reg.change()); // Used here to esnure that the value isn't deallocated first ::std::mem::sizeof_val(&x); } ```