Skip to content

Commit

Permalink
Mark __rgl_oom and __rd_oom as "C-unwind"
Browse files Browse the repository at this point in the history
  • Loading branch information
Amanieu committed Feb 5, 2022
1 parent b1b8810 commit 915a160
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions library/alloc/src/alloc.rs
Expand Up @@ -396,13 +396,13 @@ pub mod __alloc_error_handler {

// if there is no `#[alloc_error_handler]`
#[rustc_std_internal_symbol]
pub unsafe extern "C" fn __rdl_oom(size: usize, _align: usize) -> ! {
pub unsafe extern "C-unwind" fn __rdl_oom(size: usize, _align: usize) -> ! {
panic!("memory allocation of {} bytes failed", size)
}

// if there is an `#[alloc_error_handler]`
#[rustc_std_internal_symbol]
pub unsafe extern "C" fn __rg_oom(size: usize, align: usize) -> ! {
pub unsafe extern "C-unwind" fn __rg_oom(size: usize, align: usize) -> ! {
let layout = unsafe { Layout::from_size_align_unchecked(size, align) };
extern "Rust" {
#[lang = "oom"]
Expand Down
1 change: 1 addition & 0 deletions library/alloc/src/lib.rs
Expand Up @@ -163,6 +163,7 @@
#![cfg_attr(test, feature(test))]
#![feature(unboxed_closures)]
#![feature(unsized_fn_params)]
#![feature(c_unwind)]
//
// Rustdoc features:
#![feature(doc_cfg)]
Expand Down

0 comments on commit 915a160

Please sign in to comment.