Merge pull request #22 from joseluisq/feature/jemalloc_allocator
Use jemalloc as global allocator only on Linux Musl
Diff
Cargo.lock | 28 ++++++++++++++++++++++++++++
Cargo.toml | 7 ++++++-
src/main.rs | 4 ++++
3 files changed, 38 insertions(+), 1 deletion(-)
@@ -188,6 +188,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b"
[[package]]
name = "fs_extra"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5f2a4a2034423744d2cc7ca2068453168dcdb82c438419e639a26bd87839c674"
[[package]]
name = "fuchsia-cprng"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -332,6 +338,27 @@ dependencies = [
]
[[package]]
name = "jemalloc-sys"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0d3b9f3f5c9b31aa0f5ed3260385ac205db665baa41d49bb8338008ae94ede45"
dependencies = [
"cc",
"fs_extra",
"libc",
]
[[package]]
name = "jemallocator"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "43ae63fcfc45e99ab3d1b29a46782ad679e98436c3169d15a167a1108a724b69"
dependencies = [
"jemalloc-sys",
"libc",
]
[[package]]
name = "language-tags"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -920,6 +947,7 @@ dependencies = [
"iron-cors",
"iron-test",
"iron_staticfile_middleware",
"jemallocator",
"log 0.4.8",
"nix",
"openssl",
@@ -33,6 +33,9 @@ nix = "0.14"
signal = "0.7"
iron-cors = "0.8"
[target.'cfg(all(target_env = "musl", target_pointer_width = "64"))'.dependencies.jemallocator]
version = "0.3"
[dev-dependencies]
openssl = { version = "0.10", features = ["vendored"] }
hyper = "0.10"
@@ -40,4 +43,6 @@ iron-test = "0.6"
tempdir = "0.3"
[profile.release]
lto = true
lto = "fat"
codegen-units = 1
panic = "abort"
@@ -1,3 +1,7 @@
#[cfg(all(target_env = "musl", target_pointer_width = "64"))]
#[global_allocator]
static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;
#[macro_use]
extern crate log;