1 unstable release

0.3.0 Apr 10, 2019

#6 in #globalalloc

Download history 233/week @ 2024-11-16 426/week @ 2024-11-23 502/week @ 2024-11-30 339/week @ 2024-12-07 350/week @ 2024-12-14 320/week @ 2024-12-21 290/week @ 2024-12-28 343/week @ 2025-01-04 412/week @ 2025-01-11 299/week @ 2025-01-18 213/week @ 2025-01-25 560/week @ 2025-02-01 751/week @ 2025-02-08 270/week @ 2025-02-15 476/week @ 2025-02-22 932/week @ 2025-03-01

2,628 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