about summary refs log tree commit diff
path: root/library/alloc/src/alloc.rs
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2020-11-15 18:40:49 +0100
committerRalf Jung <post@ralfj.de>2020-11-15 18:40:49 +0100
commitaf869c2f8dea8efb2a2d10a44d200cb769b4956c (patch)
treecc97b9defafcac26a70cd032b025b442ed119228 /library/alloc/src/alloc.rs
parent5fab31e5ddf5f2613bf57a0a7286dc6f5887e1cb (diff)
downloadrust-af869c2f8dea8efb2a2d10a44d200cb769b4956c.tar.gz
rust-af869c2f8dea8efb2a2d10a44d200cb769b4956c.zip
document that __rust_alloc is also magic to our LLVM fork
Diffstat (limited to 'library/alloc/src/alloc.rs')
-rw-r--r--library/alloc/src/alloc.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/library/alloc/src/alloc.rs b/library/alloc/src/alloc.rs
index 0a4f88dedbb..3427c83a18f 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;