]> git.lizzy.rs Git - rust.git/commit
Add an "allocator" attribute to mark functions as allocators
authorBjörn Steinbrink <bsteinbr@gmail.com>
Fri, 13 Mar 2015 02:19:30 +0000 (03:19 +0100)
committerBjörn Steinbrink <bsteinbr@gmail.com>
Fri, 13 Mar 2015 02:19:30 +0000 (03:19 +0100)
commit0942803f502d164883294e29238e3ac4822867ed
treedb8ccf90663de0ca953c24f896abe519148f7754
parent49f7550a25722fbdb779eef80afa85f6d802f7e8
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/heap.rs
src/liballoc/lib.rs
src/librustc_trans/trans/base.rs
src/librustc_trans/trans/foreign.rs
src/libsyntax/feature_gate.rs