about summary refs log tree commit diff
path: root/src/liballoc_jemalloc/lib.rs
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2016-04-05 16:43:21 +0530
committerManish Goregaokar <manishsmail@gmail.com>2016-04-05 16:43:21 +0530
commit37cadec16e235ccf2197dc09f66216aeb616c84c (patch)
tree53a2a64bd1422f16b0b2ab109b2004ee19eddf12 /src/liballoc_jemalloc/lib.rs
parent22c229d88c6897ed3b10d31ff5a0c43f259eaff1 (diff)
parent9f3de647326fbe50e0e283b9018ab7c41abccde3 (diff)
downloadrust-37cadec16e235ccf2197dc09f66216aeb616c84c.tar.gz
rust-37cadec16e235ccf2197dc09f66216aeb616c84c.zip
Rollup merge of #32686 - mneumann:dragonfly_jemalloc_prefix, r=alexcrichton
Prefix jemalloc on DragonFly to prevent segfaults.

Similar to commits ed015456a114ae907a36af80c06f81ea93182a24 (iOS)
and e3b414d8612314e74e2b0ebde1ed5c6997d28e8d (Android)
Diffstat (limited to 'src/liballoc_jemalloc/lib.rs')
-rw-r--r--src/liballoc_jemalloc/lib.rs19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/liballoc_jemalloc/lib.rs b/src/liballoc_jemalloc/lib.rs
index c96d303e6bb..3a30bebec54 100644
--- a/src/liballoc_jemalloc/lib.rs
+++ b/src/liballoc_jemalloc/lib.rs
@@ -42,22 +42,27 @@ use libc::{c_int, c_void, size_t};
 extern {}
 
 // Note that the symbols here are prefixed by default on OSX (we don't
-// explicitly request it), and on Android we explicitly request it as
-// unprefixing cause segfaults (mismatches in allocators).
+// explicitly request it), and on Android and DragonFly we explicitly request
+// it as unprefixing cause segfaults (mismatches in allocators).
 extern {
-    #[cfg_attr(any(target_os = "macos", target_os = "android", target_os = "ios"),
+    #[cfg_attr(any(target_os = "macos", target_os = "android", target_os = "ios",
+                   target_os = "dragonfly"),
                link_name = "je_mallocx")]
     fn mallocx(size: size_t, flags: c_int) -> *mut c_void;
-    #[cfg_attr(any(target_os = "macos", target_os = "android", target_os = "ios"),
+    #[cfg_attr(any(target_os = "macos", target_os = "android", target_os = "ios",
+                   target_os = "dragonfly"),
                link_name = "je_rallocx")]
     fn rallocx(ptr: *mut c_void, size: size_t, flags: c_int) -> *mut c_void;
-    #[cfg_attr(any(target_os = "macos", target_os = "android", target_os = "ios"),
+    #[cfg_attr(any(target_os = "macos", target_os = "android", target_os = "ios",
+                   target_os = "dragonfly"),
                link_name = "je_xallocx")]
     fn xallocx(ptr: *mut c_void, size: size_t, extra: size_t, flags: c_int) -> size_t;
-    #[cfg_attr(any(target_os = "macos", target_os = "android", target_os = "ios"),
+    #[cfg_attr(any(target_os = "macos", target_os = "android", target_os = "ios",
+                   target_os = "dragonfly"),
                link_name = "je_sdallocx")]
     fn sdallocx(ptr: *mut c_void, size: size_t, flags: c_int);
-    #[cfg_attr(any(target_os = "macos", target_os = "android", target_os = "ios"),
+    #[cfg_attr(any(target_os = "macos", target_os = "android", target_os = "ios",
+                   target_os = "dragonfly"),
                link_name = "je_nallocx")]
     fn nallocx(size: size_t, flags: c_int) -> size_t;
 }