Skip to content
This repository was archived by the owner on Mar 7, 2021. It is now read-only.

Update the API we for setting the alloc error handler #71

Merged
merged 2 commits into from
Apr 28, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/allocator.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use core::alloc::{AllocErr, GlobalAlloc, Layout};
use core::alloc::{GlobalAlloc, Layout};

use bindings;
use c_types;
Expand All @@ -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!");
}
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down