Skip to content

Commit b4c91f9

Browse files
committed
Add #[cold] to abort and handle_alloc_error
1 parent 7d747db commit b4c91f9

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

library/alloc/src/alloc.rs

+1
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,7 @@ extern "Rust" {
360360
#[stable(feature = "global_alloc", since = "1.28.0")]
361361
#[cfg(not(any(test, bootstrap)))]
362362
#[rustc_allocator_nounwind]
363+
#[cold]
363364
pub fn handle_alloc_error(layout: Layout) -> ! {
364365
unsafe {
365366
__rust_alloc_error_handler(layout.size(), layout.align());

library/std/src/process.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1779,6 +1779,7 @@ pub fn exit(code: i32) -> ! {
17791779
///
17801780
/// [panic hook]: crate::panic::set_hook
17811781
#[stable(feature = "process_abort", since = "1.17.0")]
1782+
#[cold]
17821783
pub fn abort() -> ! {
17831784
crate::sys::abort_internal();
17841785
}

0 commit comments

Comments
 (0)