diff --git a/src/allocator.rs b/src/allocator.rs index ddb06533..ee17f353 100644 --- a/src/allocator.rs +++ b/src/allocator.rs @@ -1,4 +1,4 @@ -use core::alloc::{AllocErr, GlobalAlloc, Layout}; +use core::alloc::{GlobalAlloc, Layout}; use bindings; use c_types; @@ -21,7 +21,7 @@ unsafe impl GlobalAlloc for KernelAllocator { } } -#[lang = "oom"] -extern "C" fn oom(_err: AllocErr) -> ! { +#[alloc_error_handler] +extern "C" fn oom(_layout: Layout) -> ! { panic!("Out of memory!"); } diff --git a/src/lib.rs b/src/lib.rs index 0c540aeb..589bf1c9 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,5 +1,5 @@ #![no_std] -#![feature(alloc, allocator_api, const_fn, lang_items, panic_handler)] +#![feature(alloc, allocator_api, const_fn, lang_items, panic_handler, alloc_error_handler)] #[macro_use] extern crate alloc;