Commit 631c466d authored by Martin Kröning's avatar Martin Kröning 🦀
Browse files

Use alloc_error_handler instead of lang_item

parent 36911f3f
......@@ -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