about summary refs log tree commit diff
path: root/src/liballoc
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2015-03-13 18:11:51 +0530
committerManish Goregaokar <manishsmail@gmail.com>2015-03-13 18:11:51 +0530
commitd0f98fcc7fd9846c6925eb46f969febef99ae9c3 (patch)
tree5a7ed287281219714e97fb0647ef6b7d02a9b45d /src/liballoc
parent63cd9f9d8948ad9fe138c327f2298739a240daba (diff)
parent0942803f502d164883294e29238e3ac4822867ed (diff)
downloadrust-d0f98fcc7fd9846c6925eb46f969febef99ae9c3.tar.gz
rust-d0f98fcc7fd9846c6925eb46f969febef99ae9c3.zip
Rollup merge of #23322 - dotdash:jemalloc_attrs, r=brson
 When this attribute is applied to a function, its return value gets the
noalias attribute, which is how you tell LLVM that the function returns
a \"new\" pointer that doesn't alias anything accessible to the caller,
i.e. it acts like a memory allocator.

Plain malloc doesn't need this attribute because LLVM already knows
about malloc and adds the attribute itself.
Diffstat (limited to 'src/liballoc')
-rw-r--r--src/liballoc/heap.rs1
-rw-r--r--src/liballoc/lib.rs1
2 files changed, 2 insertions, 0 deletions
diff --git a/src/liballoc/heap.rs b/src/liballoc/heap.rs
index 3b93171386a..f9936b7a16a 100644
--- a/src/liballoc/heap.rs
+++ b/src/liballoc/heap.rs
@@ -198,6 +198,7 @@ mod imp {
     extern {}
 
     extern {
+        #[allocator]
         fn je_mallocx(size: size_t, flags: c_int) -> *mut c_void;
         fn je_rallocx(ptr: *mut c_void, size: size_t, flags: c_int) -> *mut c_void;
         fn je_xallocx(ptr: *mut c_void, size: size_t, extra: size_t, flags: c_int) -> size_t;
diff --git a/src/liballoc/lib.rs b/src/liballoc/lib.rs
index 5c9a42a8a71..34c0686fe37 100644
--- a/src/liballoc/lib.rs
+++ b/src/liballoc/lib.rs
@@ -69,6 +69,7 @@
 
 #![feature(no_std)]
 #![no_std]
+#![feature(allocator)]
 #![feature(lang_items, unsafe_destructor)]
 #![feature(box_syntax)]
 #![feature(optin_builtin_traits)]