Skip to main content

Zone

Struct Zone 

Source
pub struct Zone {
    pa_range: Range<u64>,
    free_areas: [FreeArea; 11],
}
Expand description

A contiguous physical memory range to be managed by a (buddy) allocator. free_areas : free-lists for difference sizes (in order of 2).

IMPORTANT: the Zone, or the global ZONE object is unprotected in any sense. One must synchronize the operations via a sane Allocator object.

Fields§

§pa_range: Range<u64>§free_areas: [FreeArea; 11]

Implementations§

Source§

impl Zone

Source

pub const fn default() -> Self

Source

pub fn get_buddy(&self, frame: &FrameDesc) -> Option<FrameDesc>

Source

pub fn get_buddy_by_pa(&self, pa: u64, order: usize) -> Option<u64>

Source

pub fn contains(&self, frame: &FrameDesc) -> bool

Trait Implementations§

Source§

impl Debug for Zone

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl !Send for Zone

§

impl !Sync for Zone

§

impl Freeze for Zone

§

impl RefUnwindSafe for Zone

§

impl Unpin for Zone

§

impl UnsafeUnpin for Zone

§

impl UnwindSafe for Zone

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 = !

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.