From 78a79e46c9daca03e59636e697a938edd85c3437 Mon Sep 17 00:00:00 2001 From: Robert O'Callahan Date: Thu, 1 Oct 2020 11:48:20 +1300 Subject: [PATCH 1/2] Fix syntax error --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index c8e9cf262b..6dbc07e5ef 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -122,7 +122,7 @@ unsafe impl GlobalAlloc for Jemalloc { #[inline] unsafe fn dealloc(&self, ptr: *mut u8, layout: Layout) { - assume!(!ptr.is_null()) + assume!(!ptr.is_null()); assume!(layout.size() != 0); let flags = layout_to_flags(layout.align(), layout.size()); ffi::sdallocx(ptr as *mut c_void, layout.size(), flags) From 5c990e38f834ba28ef29c9250c12456173c19236 Mon Sep 17 00:00:00 2001 From: Robert O'Callahan Date: Thu, 1 Oct 2020 11:49:09 +1300 Subject: [PATCH 2/2] Pass explicit --enable or --disable to the jemalloc configure.ac to avoid depending on jemalloc defaults (which could change) Resolves #160 --- jemalloc-sys/build.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/jemalloc-sys/build.rs b/jemalloc-sys/build.rs index 39eb5740d6..d5aa5c891f 100644 --- a/jemalloc-sys/build.rs +++ b/jemalloc-sys/build.rs @@ -303,24 +303,34 @@ fn main() { cmd.arg("--with-private-namespace=_rjem_"); + // Always pass explicit --enable or --disable so changes in jemalloc + // defaults don't break us. if env::var("CARGO_FEATURE_DEBUG").is_ok() { info!("CARGO_FEATURE_DEBUG set"); cmd.arg("--enable-debug"); + } else { + cmd.arg("--disable-debug"); } if env::var("CARGO_FEATURE_PROFILING").is_ok() { info!("CARGO_FEATURE_PROFILING set"); cmd.arg("--enable-prof"); + } else { + cmd.arg("--disable-prof"); } if env::var("CARGO_FEATURE_STATS").is_ok() { info!("CARGO_FEATURE_STATS set"); cmd.arg("--enable-stats"); + } else { + cmd.arg("--disable-stats"); } if env::var("CARGO_FEATURE_DISABLE_INITIAL_EXEC_TLS").is_ok() { info!("CARGO_FEATURE_DISABLE_INITIAL_EXEC_TLS set"); cmd.arg("--disable-initial-exec-tls"); + } else { + cmd.arg("--enable-initial-exec-tls"); } cmd.arg(format!("--host={}", gnu_target(&target)));