2024-10-04 15:41:11 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
|
|
|
|
|
|
|
#![allow(missing_docs)]
|
|
|
|
|
|
|
|
use super::{AllocError, Allocator, Flags};
|
|
|
|
use core::alloc::Layout;
|
|
|
|
use core::ptr::NonNull;
|
|
|
|
|
|
|
|
pub struct Kmalloc;
|
2024-10-04 15:41:12 +00:00
|
|
|
pub type Vmalloc = Kmalloc;
|
2024-10-04 15:41:13 +00:00
|
|
|
pub type KVmalloc = Kmalloc;
|
2024-10-04 15:41:11 +00:00
|
|
|
|
|
|
|
unsafe impl Allocator for Kmalloc {
|
|
|
|
unsafe fn realloc(
|
|
|
|
_ptr: Option<NonNull<u8>>,
|
|
|
|
_layout: Layout,
|
|
|
|
_old_layout: Layout,
|
|
|
|
_flags: Flags,
|
|
|
|
) -> Result<NonNull<[u8]>, AllocError> {
|
|
|
|
panic!();
|
|
|
|
}
|
|
|
|
}
|