From 0942803f502d164883294e29238e3ac4822867ed Mon Sep 17 00:00:00 2001 From: Björn Steinbrink Date: Fri, 13 Mar 2015 03:19:30 +0100 Subject: Add an "allocator" attribute to mark functions as allocators 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. --- src/liballoc/lib.rs | 1 + 1 file changed, 1 insertion(+) (limited to 'src/liballoc/lib.rs') 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)] -- cgit 1.4.1-3-g733a5