Struct GlobalAllocator

Source
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

Source§

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>)

Safety Read more
Source§

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>

🔬This is a nightly-only experimental API. (kernel_physical_allocator_non_contiguous)
1.0.0 · Source§

fn allocate_one(&self) -> Result<Frame, AllocError>

Allocates a single Frame
Source§

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 buffer
Source§

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 frames
Source§

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 T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.