1 // SPDX-License-Identifier: GPL-2.0 2 3 #![allow(missing_docs)] 4 5 use super::{AllocError, Allocator, Flags}; 6 use core::alloc::Layout; 7 use core::ptr::NonNull; 8 9 pub struct Kmalloc; 10 pub type Vmalloc = Kmalloc; 11 pub type KVmalloc = Kmalloc; 12 13 unsafe impl Allocator for Kmalloc { 14 unsafe fn realloc( 15 _ptr: Option<NonNull<u8>>, 16 _layout: Layout, 17 _old_layout: Layout, 18 _flags: Flags, 19 ) -> Result<NonNull<[u8]>, AllocError> { 20 panic!(); 21 } 22 } 23