diff options
| author | Benoît du Garreau <benoit.dugarreau@platform.sh> | 2020-11-18 18:15:03 +0100 |
|---|---|---|
| committer | Benoît du Garreau <benoit.dugarreau@platform.sh> | 2020-11-18 18:15:03 +0100 |
| commit | b4c91f9a525096b52eaf3f0ffc5b147e39bca4a8 (patch) | |
| tree | ce0b215bc1138660ae029be442c05b1186c17f12 | |
| parent | 7d747db0d5dd8f08f2efb073e2e77a34553465a7 (diff) | |
| download | rust-b4c91f9a525096b52eaf3f0ffc5b147e39bca4a8.tar.gz rust-b4c91f9a525096b52eaf3f0ffc5b147e39bca4a8.zip | |
Add #[cold] to `abort` and `handle_alloc_error`
| -rw-r--r-- | library/alloc/src/alloc.rs | 1 | ||||
| -rw-r--r-- | library/std/src/process.rs | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/library/alloc/src/alloc.rs b/library/alloc/src/alloc.rs index 3427c83a18f..7fcbffa7e43 100644 --- a/library/alloc/src/alloc.rs +++ b/library/alloc/src/alloc.rs @@ -360,6 +360,7 @@ extern "Rust" { #[stable(feature = "global_alloc", since = "1.28.0")] #[cfg(not(any(test, bootstrap)))] #[rustc_allocator_nounwind] +#[cold] pub fn handle_alloc_error(layout: Layout) -> ! { unsafe { __rust_alloc_error_handler(layout.size(), layout.align()); diff --git a/library/std/src/process.rs b/library/std/src/process.rs index 2c7ed4614bc..2ffa7d2316a 100644 --- a/library/std/src/process.rs +++ b/library/std/src/process.rs @@ -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(); } |
