#allocator

sys tcmalloc-sys

Drop-in global allocator using tcmalloc

1 unstable release

✓ Uses Rust 2018 edition

0.3.0 Apr 10, 2019

#68 in #allocator

Download history 23/week @ 2019-12-14 14/week @ 2019-12-21 18/week @ 2019-12-28 25/week @ 2020-01-04 22/week @ 2020-01-11 18/week @ 2020-01-18 17/week @ 2020-01-25 18/week @ 2020-02-01 14/week @ 2020-02-08 12/week @ 2020-02-15 20/week @ 2020-02-22 18/week @ 2020-02-29 19/week @ 2020-03-07 24/week @ 2020-03-14 19/week @ 2020-03-21 26/week @ 2020-03-28

91 downloads per month
Used in tcmalloc

MIT/Apache

4KB
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