Skip to content

rust: remove alloc_error_handler #426

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 4, 2021
Merged
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
10 changes: 0 additions & 10 deletions rust/kernel/allocator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,6 @@ unsafe impl GlobalAlloc for KernelAllocator {
#[global_allocator]
static ALLOCATOR: KernelAllocator = KernelAllocator;

#[alloc_error_handler]
fn oom(_layout: Layout) -> ! {
panic!("Out of memory!");
}

// `rustc` only generates these for some crate types. Even then, we would need
// to extract the object file that has them from the archive. For the moment,
// let's generate them ourselves instead.
Expand Down Expand Up @@ -66,8 +61,3 @@ pub fn __rust_alloc_zeroed(size: usize, _align: usize) -> *mut u8 {
) as *mut u8
}
}

#[no_mangle]
pub fn __rust_alloc_error_handler(_size: usize, _align: usize) -> ! {
panic!("Out of memory!");
}