[go: up one dir, main page]

dhat 0.3.3

A library for heap profiling and ad hoc profiling with DHAT.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// This is a very simple example of how to do heap profiling of a program. You
// may want to create a feature called `dhat-heap` in your `Cargo.toml` and
// uncomment the `#[cfg(feature = "dhat-heap")]` attributes.

//#[cfg(feature = "dhat-heap")]
#[global_allocator]
static ALLOC: dhat::Alloc = dhat::Alloc;

fn main() {
    //#[cfg(feature = "dhat-heap")]
    let _profiler = dhat::Profiler::new_heap();

    println!("Hello, world!");
}