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.
This commit is contained in:
@@ -69,6 +69,7 @@
|
||||
|
||||
#![feature(no_std)]
|
||||
#![no_std]
|
||||
#![feature(allocator)]
|
||||
#![feature(lang_items, unsafe_destructor)]
|
||||
#![feature(box_syntax)]
|
||||
#![feature(optin_builtin_traits)]
|
||||
|
||||
Reference in New Issue
Block a user