Skip to content

Commit

Permalink
Auto merge of rust-lang#79172 - a1phyr:cold_abort, r=Mark-Simulacrum
Browse files Browse the repository at this point in the history
Add #[cold] attribute to `std::process::abort` and `alloc::alloc::handle_alloc_error`
  • Loading branch information
bors committed Nov 23, 2020
2 parents 32da90b + b4c91f9 commit f32459c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions library/alloc/src/alloc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,7 @@ extern "Rust" {
#[stable(feature = "global_alloc", since = "1.28.0")]
#[cfg(not(test))]
#[rustc_allocator_nounwind]
#[cold]
pub fn handle_alloc_error(layout: Layout) -> ! {
unsafe {
__rust_alloc_error_handler(layout.size(), layout.align());
Expand Down
1 change: 1 addition & 0 deletions library/std/src/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1779,6 +1779,7 @@ pub fn exit(code: i32) -> ! {
///
/// [panic hook]: crate::panic::set_hook
#[stable(feature = "process_abort", since = "1.17.0")]
#[cold]
pub fn abort() -> ! {
crate::sys::abort_internal();
}
Expand Down

0 comments on commit f32459c

Please sign in to comment.