pub struct GlobalAllocator {
pub rwlock: RwSpinlock<Option<&'static dyn PhysicalAllocator>>,
}
🔬This is a nightly-only experimental API. (
kernel_internals
)Fields§
§rwlock: RwSpinlock<Option<&'static dyn PhysicalAllocator>>
🔬This is a nightly-only experimental API. (
kernel_internals
)Trait Implementations§
Source§impl PhysicalAllocator for GlobalAllocator
impl PhysicalAllocator for GlobalAllocator
Source§fn allocate_contiguous(&self, frame_count: usize) -> Result<Frame, AllocError>
fn allocate_contiguous(&self, frame_count: usize) -> Result<Frame, AllocError>
Allocates a contiguous range of physical memory
Source§unsafe fn deallocate_contiguous(&self, base: Frame, frame_count: NonZero<usize>)
unsafe fn deallocate_contiguous(&self, base: Frame, frame_count: NonZero<usize>)
Safety Read more
Source§fn allocate_at(
&self,
frame_count: usize,
location: SpecificLocation,
) -> Result<Frame, AllocError>
fn allocate_at( &self, frame_count: usize, location: SpecificLocation, ) -> Result<Frame, AllocError>
🔬This is a nightly-only experimental API. (
kernel_physical_allocator_location
)Source§fn allocate(
&self,
frame_count: usize,
) -> Result<AllocateNonContiguousRet, AllocError>
fn allocate( &self, frame_count: usize, ) -> Result<AllocateNonContiguousRet, AllocError>
🔬This is a nightly-only experimental API. (
kernel_physical_allocator_non_contiguous
)1.0.0 · Source§fn allocate_one(&self) -> Result<Frame, AllocError>
fn allocate_one(&self) -> Result<Frame, AllocError>
Allocates a single
Frame
Source§fn try_allocate_zeroed(
&self,
frame_count: usize,
) -> Result<Frame, ZeroAllocError>
fn try_allocate_zeroed( &self, frame_count: usize, ) -> Result<Frame, ZeroAllocError>
🔬This is a nightly-only experimental API. (
kernel_allocation_zeroing
#2)Tries to allocate a contiguous region of
frame_count
frames from a prezeroed bufferSource§fn allocate_zeroed(&self, frame_count: usize) -> Result<Frame, AllocError>
fn allocate_zeroed(&self, frame_count: usize) -> Result<Frame, AllocError>
🔬This is a nightly-only experimental API. (
kernel_allocation_zeroing
#2)Allocates a contiguous region of
frame_count
frames, manually zeroing them if there were no prezeroed framesSource§fn push(&mut self, _allocation: AllocationMeta)
fn push(&mut self, _allocation: AllocationMeta)
🔬This is a nightly-only experimental API. (
kernel_allocation_new
#5)Auto Trait Implementations§
impl !Freeze for GlobalAllocator
impl !RefUnwindSafe for GlobalAllocator
impl Send for GlobalAllocator
impl Sync for GlobalAllocator
impl Unpin for GlobalAllocator
impl !UnwindSafe for GlobalAllocator
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more