Rollup merge of #79077 - RalfJung:llvm-magic, r=Mark-Simulacrum

document that __rust_alloc is also magic to our LLVM fork

Based on [comments](https://github.com/rust-lang/rust/pull/79045#discussion_r523442198) by ````@tmiasko```` and ````@bjorn3.````
This commit is contained in:
Mara Bos 2020-11-17 10:06:23 +01:00 committed by GitHub
commit 70a4e433b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -23,6 +23,8 @@
// (the code expanding that attribute macro generates those functions), or to call
// the default implementations in libstd (`__rdl_alloc` etc. in `library/std/src/alloc.rs`)
// otherwise.
// The rustc fork of LLVM also special-cases these function names to be able to optimize them
// like `malloc`, `realloc`, and `free`, respectively.
#[rustc_allocator]
#[rustc_allocator_nounwind]
fn __rust_alloc(size: usize, align: usize) -> *mut u8;