#allocator

sys jemalloc-sys

Rust FFI bindings to jemalloc

9 releases

0.1.8 Oct 20, 2018
0.1.7 Jul 4, 2018
0.1.6 May 22, 2018
0.1.5 Apr 15, 2018
0.1.0 Jan 21, 2016

#5 in Memory management

Download history 313/week @ 2018-10-11 414/week @ 2018-10-18 253/week @ 2018-10-25 437/week @ 2018-11-01 1096/week @ 2018-11-08 1111/week @ 2018-11-15 1108/week @ 2018-11-22 1059/week @ 2018-11-29 1217/week @ 2018-12-06 1379/week @ 2018-12-13 1295/week @ 2018-12-20 1491/week @ 2018-12-27 1271/week @ 2019-01-03

4,305 downloads per month
Used in 5 crates (2 directly)

MIT/Apache

1MB
30K SLoC

C 29K SLoC // 0.1% comments Shell 493 SLoC // 0.2% comments Rust 374 SLoC // 0.6% comments C++ 214 SLoC // 0.1% comments Python 162 SLoC // 0.1% comments XSL 10 SLoC

jemalloc-sys - Rust bindings to the jemalloc C library

Note: the Rust allocator API is implemented for jemalloc in the jemallocator crate.

jemalloc is a general purpose memory allocation, its documentation can be found here:

  • [API documentation][jemalloc_docs]
  • [Wiki][jemalloc_wiki] (design documents, presentations, profiling, debugging, tuning, ...)

Current jemalloc version: 5.1.

Feature flags

This crate provides following cargo feature flags:

  • profiling: configure jemalloc with --enable-prof.

  • stats: configure jemalloc with --enable-stats.

  • debug: configure jemalloc with --enable-debug.

  • bg_thread (enabled by default): when disabled, configure jemalloc with --with-malloc-conf=background_thread:false.

  • unprefixed_malloc_on_supported_platforms: when disabled, configure jemalloc with --with-jemalloc-prefix=_rjem_. Enabling this causes symbols like malloc to be emitted without a prefix, overriding the ones defined by libc. This usually causes C and C++ code linked in the same program to use jemalloc as well.

    On some platforms prefixes are always used because unprefixing is known to cause segfaults due to allocator mismatches.

See jemalloc/INSTALL.md.

License

This project is licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in jemallocator by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

  • libc 0.2.8
  • links jemalloc
  • build build.rs
  • build cc 1.0
  • build fs_extra 1.1