Skip to main content

BuddyAllocator

Struct BuddyAllocator 

Source
pub struct BuddyAllocator {
    zone: Zone,
}

Fields§

§zone: Zone

Implementations§

Source§

impl BuddyAllocator

Source

pub const fn default() -> Self

Source

pub unsafe fn free_frame_by_pa(&mut self, paddr: u64, order: usize)

Source

pub unsafe fn free_frame_by_desc(&mut self, frame: &FrameDesc)

Source

pub fn print_debug_info(&self)

Source

pub fn alloc_frame(&mut self, order: usize) -> Option<FrameDesc>

Source

fn split_buddy_block(&mut self, n: *mut Node, order: usize)

Source

fn recursive_split_down(&mut self, order: usize) -> Option<*const Node>

Source

pub unsafe fn init(&mut self, start: u64, end: u64)

[start: end) the physical address range to initialize the PFA. unsafe because it assumes no data race. This could only work safely during system initialization.

Trait Implementations§

Source§

impl Debug for BuddyAllocator

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl !Send for BuddyAllocator

§

impl !Sync for BuddyAllocator

§

impl Freeze for BuddyAllocator

§

impl RefUnwindSafe for BuddyAllocator

§

impl Unpin for BuddyAllocator

§

impl UnsafeUnpin for BuddyAllocator

§

impl UnwindSafe for BuddyAllocator

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.