From af869c2f8dea8efb2a2d10a44d200cb769b4956c Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sun, 15 Nov 2020 18:40:49 +0100 Subject: [PATCH] document that __rust_alloc is also magic to our LLVM fork --- library/alloc/src/alloc.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/library/alloc/src/alloc.rs b/library/alloc/src/alloc.rs index 0a4f88dedbb07..3427c83a18f2a 100644 --- a/library/alloc/src/alloc.rs +++ b/library/alloc/src/alloc.rs @@ -23,6 +23,8 @@ extern "Rust" { // (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;