From 0e74affe0c1e2b3b372328c8ee2f55622a251551 Mon Sep 17 00:00:00 2001 From: Miguel Ojeda Date: Sun, 4 Jul 2021 11:58:48 +0200 Subject: [PATCH] rust: remove `alloc_error_handler` Closes https://github.com/Rust-for-Linux/linux/issues/424. Suggested-by: bjorn3 Signed-off-by: Miguel Ojeda --- rust/kernel/allocator.rs | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/rust/kernel/allocator.rs b/rust/kernel/allocator.rs index a942f2a32f9569..759cec47de2b15 100644 --- a/rust/kernel/allocator.rs +++ b/rust/kernel/allocator.rs @@ -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. @@ -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!"); -}