pub enum PhysMemError {
OutOfMemory,
AllocationTooLarge,
ZeroAllocation,
UnalignedAddress,
AddressOutOfRange,
NotAllocated,
SizeMismatch,
NotInitialized,
InvalidOrder,
InternalCorruption,
}Expand description
Physical memory allocator errors.
These errors are returned by the buddy allocator when operations fail.
They can be converted to KernelError for use in syscall contexts.
Variants§
OutOfMemory
No memory available for the requested allocation.
AllocationTooLarge
The requested allocation size is too large.
The maximum allocation size is 512 pages (2MB).
ZeroAllocation
The requested allocation size is zero.
UnalignedAddress
The address is not page-aligned.
AddressOutOfRange
The address is outside the managed memory range.
NotAllocated
The block at the specified address is not allocated.
This can happen when trying to free memory that was never allocated or has already been freed (double-free detection).
SizeMismatch
The free operation has an incorrect size.
The size passed to free_pages must match the original allocation size.
NotInitialized
The allocator has not been initialized.
InvalidOrder
Invalid order specified (exceeds MAX_ORDER).
InternalCorruption
Internal allocator corruption detected.
This indicates a bug in the allocator or memory corruption.
Implementations§
Source§impl PhysMemError
impl PhysMemError
Sourcepub const fn to_kernel_error(self) -> KernelError
pub const fn to_kernel_error(self) -> KernelError
Converts this error to a KernelError.
This allows physical memory errors to be propagated through the kernel’s standard error handling mechanism.
Trait Implementations§
Source§impl Clone for PhysMemError
impl Clone for PhysMemError
Source§fn clone(&self) -> PhysMemError
fn clone(&self) -> PhysMemError
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more