Skip to content

Commit af869c2

Browse files
committedNov 15, 2020
document that __rust_alloc is also magic to our LLVM fork
1 parent 5fab31e commit af869c2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed
 

‎library/alloc/src/alloc.rs

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

0 commit comments

Comments
 (0)
Please sign in to comment.