1 unstable release

0.3.0 Apr 10, 2019

#8 in #globalalloc

Download history 117/week @ 2023-12-18 100/week @ 2023-12-25 134/week @ 2024-01-01 357/week @ 2024-01-08 416/week @ 2024-01-15 300/week @ 2024-01-22 391/week @ 2024-01-29 233/week @ 2024-02-05 169/week @ 2024-02-12 294/week @ 2024-02-19 180/week @ 2024-02-26 146/week @ 2024-03-04 184/week @ 2024-03-11 232/week @ 2024-03-18 196/week @ 2024-03-25 225/week @ 2024-04-01

855 downloads per month
Used in 3 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