Add #[cold] to abort
and handle_alloc_error
This commit is contained in:
parent
7d747db0d5
commit
b4c91f9a52
2 changed files with 2 additions and 0 deletions
|
@ -360,6 +360,7 @@ extern "Rust" {
|
||||||
#[stable(feature = "global_alloc", since = "1.28.0")]
|
#[stable(feature = "global_alloc", since = "1.28.0")]
|
||||||
#[cfg(not(any(test, bootstrap)))]
|
#[cfg(not(any(test, bootstrap)))]
|
||||||
#[rustc_allocator_nounwind]
|
#[rustc_allocator_nounwind]
|
||||||
|
#[cold]
|
||||||
pub fn handle_alloc_error(layout: Layout) -> ! {
|
pub fn handle_alloc_error(layout: Layout) -> ! {
|
||||||
unsafe {
|
unsafe {
|
||||||
__rust_alloc_error_handler(layout.size(), layout.align());
|
__rust_alloc_error_handler(layout.size(), layout.align());
|
||||||
|
|
|
@ -1779,6 +1779,7 @@ pub fn exit(code: i32) -> ! {
|
||||||
///
|
///
|
||||||
/// [panic hook]: crate::panic::set_hook
|
/// [panic hook]: crate::panic::set_hook
|
||||||
#[stable(feature = "process_abort", since = "1.17.0")]
|
#[stable(feature = "process_abort", since = "1.17.0")]
|
||||||
|
#[cold]
|
||||||
pub fn abort() -> ! {
|
pub fn abort() -> ! {
|
||||||
crate::sys::abort_internal();
|
crate::sys::abort_internal();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue