Skip to content

Commit

Permalink
document that __rust_alloc is also magic to our LLVM fork
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed Nov 15, 2020
1 parent 5fab31e commit af869c2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions library/alloc/src/alloc.rs
Expand Up @@ -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;
Expand Down

0 comments on commit af869c2

Please sign in to comment.