Unverified Commit 263e88f1 authored by bors[bot]'s avatar bors[bot] Committed by GitHub
Browse files

Merge #21



21: Use alloc_error_handler instead of lang_item r=stlankes a=mkroening
Co-authored-by: Martin Kröning's avatarMartin Kröning <mkroening@posteo.net>
parents 64a04eb0 631c466d
Pipeline #498369 passed with stages
in 6 minutes and 20 seconds
......@@ -5,9 +5,9 @@
// http://opensource.org/licenses/MIT>, at your option. This file may not be
// copied, modified, or distributed except according to those terms.
#![feature(alloc_error_handler)]
#![feature(allocator_api)]
#![feature(const_raw_ptr_to_usize_cast)]
#![feature(lang_items)]
#![feature(llvm_asm)]
#![feature(global_asm)]
#![feature(asm)]
......
......@@ -7,16 +7,11 @@
pub mod allocator;
#[cfg(not(test))]
use core::alloc::Layout;
#[cfg(not(test))]
#[lang = "oom"]
#[no_mangle]
pub fn rust_oom(layout: Layout) -> ! {
println!(
"[!!!OOM!!!] Memory allocation of {} bytes failed",
layout.size()
);
loop {}
#[alloc_error_handler]
fn alloc_error_handler(layout: Layout) -> ! {
panic!("[OOM] Allocation of {:?} failed", layout);
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment