1 unstable release

0.3.0 Apr 10, 2019

#1059 in Memory management

Download history 1367/week @ 2025-09-23 1650/week @ 2025-09-30 1351/week @ 2025-10-07 1297/week @ 2025-10-14 679/week @ 2025-10-21 1212/week @ 2025-10-28 1414/week @ 2025-11-04 2734/week @ 2025-11-11 2046/week @ 2025-11-18 1062/week @ 2025-11-25 1744/week @ 2025-12-02 1014/week @ 2025-12-09 1159/week @ 2025-12-16 1507/week @ 2025-12-23 1455/week @ 2025-12-30 1180/week @ 2026-01-06

5,422 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