]> git.lizzy.rs Git - rust.git/commitdiff
Fix liballoc
authorSteven Fackler <sfackler@gmail.com>
Mon, 29 Sep 2014 05:07:45 +0000 (22:07 -0700)
committerSteven Fackler <sfackler@palantir.com>
Tue, 30 Sep 2014 19:52:00 +0000 (12:52 -0700)
src/liballoc/heap.rs

index 349ae15eb32a0c58c0a59b50a95596ec807d9938..0d2872bcba06bbacf9eec24d7ec1a06cc1499fb7 100644 (file)
@@ -111,12 +111,12 @@ unsafe fn exchange_free(ptr: *mut u8, size: uint, align: uint) {
 // The minimum alignment guaranteed by the architecture. This value is used to
 // add fast paths for low alignment values. In practice, the alignment is a
 // constant at the call site and the branch will be optimized out.
-#[cfg(target_arch = "arm")]
-#[cfg(target_arch = "mips")]
-#[cfg(target_arch = "mipsel")]
+#[cfg(any(target_arch = "arm",
+          target_arch = "mips",
+          target_arch = "mipsel"))]
 static MIN_ALIGN: uint = 8;
-#[cfg(target_arch = "x86")]
-#[cfg(target_arch = "x86_64")]
+#[cfg(any(target_arch = "x86",
+          target_arch = "x86_64"))]
 static MIN_ALIGN: uint = 16;
 
 #[cfg(jemalloc)]
@@ -146,7 +146,7 @@ fn je_malloc_stats_print(write_cb: Option<extern "C" fn(cbopaque: *mut c_void,
     }
 
     // -lpthread needs to occur after -ljemalloc, the earlier argument isn't enough
-    #[cfg(not(windows), not(target_os = "android"))]
+    #[cfg(all(not(windows), not(target_os = "android")))]
     #[link(name = "pthread")]
     extern {}
 
@@ -206,7 +206,7 @@ pub fn stats_print() {
     }
 }
 
-#[cfg(not(jemalloc), unix)]
+#[cfg(all(not(jemalloc), unix))]
 mod imp {
     use core::cmp;
     use core::ptr;
@@ -268,7 +268,7 @@ pub fn usable_size(size: uint, _align: uint) -> uint {
     pub fn stats_print() {}
 }
 
-#[cfg(not(jemalloc), windows)]
+#[cfg(all(not(jemalloc), windows))]
 mod imp {
     use libc::{c_void, size_t};
     use libc;