Skip to content

Commit

Permalink
Rollup merge of rust-lang#79077 - RalfJung:llvm-magic, r=Mark-Simulacrum
Browse files Browse the repository at this point in the history
document that __rust_alloc is also magic to our LLVM fork

Based on [comments](rust-lang#79045 (comment)) by ````@tmiasko```` and ````@bjorn3.````
  • Loading branch information
m-ou-se committed Nov 17, 2020
2 parents 336dc18 + af869c2 commit 70a4e43
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions library/alloc/src/alloc.rs
Original file line number Diff line number Diff line change
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 70a4e43

Please sign in to comment.