8 releases

0.3.0 Apr 10, 2019
0.2.0 Feb 16, 2019
0.1.5 Feb 16, 2019
0.1.3 May 28, 2018

#398 in Memory management

Download history 976/week @ 2024-12-21 448/week @ 2024-12-28 521/week @ 2025-01-04 691/week @ 2025-01-11 580/week @ 2025-01-18 382/week @ 2025-01-25 918/week @ 2025-02-01 1483/week @ 2025-02-08 731/week @ 2025-02-15 1086/week @ 2025-02-22 1130/week @ 2025-03-01 1305/week @ 2025-03-08 1214/week @ 2025-03-15 935/week @ 2025-03-22 824/week @ 2025-03-29 966/week @ 2025-04-05

4,289 downloads per month
Used in 5 crates

MIT/Apache

8KB

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