1 unstable release

0.3.0 Apr 10, 2019

#8 in #globalalloc

Download history 192/week @ 2024-03-13 240/week @ 2024-03-20 205/week @ 2024-03-27 229/week @ 2024-04-03 177/week @ 2024-04-10 233/week @ 2024-04-17 150/week @ 2024-04-24 156/week @ 2024-05-01 230/week @ 2024-05-08 177/week @ 2024-05-15 191/week @ 2024-05-22 190/week @ 2024-05-29 237/week @ 2024-06-05 326/week @ 2024-06-12 277/week @ 2024-06-19 163/week @ 2024-06-26

1,030 downloads per month
Used in 4 crates (via tcmalloc)

MIT/Apache

5KB
72 lines

tcmalloc

A drop-in GlobalAlloc implementation using tcmalloc from gperftools.

Travis badge crates.io badge

Usage

Requires Rust 1.28+

extern crate tcmalloc;

use tcmalloc::TCMalloc;

#[global_allocator]
static GLOBAL: TCMalloc = TCMalloc;

Also note that you can only define one global allocator per application.

By default this crate expects to link to a system-installed tcmalloc. To build the bundled copy of tcmalloc, enable the "bundled" feature. Note the caveats about profiling and libunwind/libgcc on 64-bit linux — they are not built by this crate, and tcmalloc will silently link to versions of both that can cause profiling deadlocks.

Dependencies