pub struct ZoneSegment {
pub base: PhysAddr,
pub page_count: usize,
pub free_lists: [[u64; 12]; 2],
pub buddy_bitmaps: [BuddyBitmap; 12],
pub pageblock_tags: *mut u8,
pub pageblock_count: usize,
pub alloc_bitmap: BuddyBitmap,
}Expand description
One contiguous buddy-managed extent inside a zone.
Fields§
§base: PhysAddrBase physical address of this contiguous segment.
page_count: usizeNumber of pages managed by this segment.
free_lists: [[u64; 12]; 2]Free lists for each order within this segment, split by migratetype.
buddy_bitmaps: [BuddyBitmap; 12]Per-order parity bitmaps scoped to this segment only.
Per-pageblock migratetype tags used to keep movable and unmovable frees grouped.
pageblock_count: usizeNumber of pageblocks described by pageblock_tags.
alloc_bitmap: BuddyBitmapOptional debug bitmap: 1 bit per page = allocated.
Implementations§
Source§impl ZoneSegment
impl ZoneSegment
Sourcepub fn is_populated(&self) -> bool
pub fn is_populated(&self) -> bool
Returns whether this segment is populated.
Sourcepub fn contains_address(&self, addr: PhysAddr) -> bool
pub fn contains_address(&self, addr: PhysAddr) -> bool
Returns whether an address falls within the segment.
Sourcepub fn end_address(&self) -> u64
pub fn end_address(&self) -> u64
Returns the exclusive end address of the segment.
Sourcepub fn free_list_count(&self, order: u8) -> usize
pub fn free_list_count(&self, order: u8) -> usize
Count the number of free blocks at a given order.
Sourcepub fn free_list_count_for(&self, order: u8, migratetype: Migratetype) -> usize
pub fn free_list_count_for(&self, order: u8, migratetype: Migratetype) -> usize
Count the number of free blocks at a given order and migratetype.
Trait Implementations§
Source§impl Clone for ZoneSegment
impl Clone for ZoneSegment
Source§fn clone(&self) -> ZoneSegment
fn clone(&self) -> ZoneSegment
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ZoneSegment
Auto Trait Implementations§
impl Freeze for ZoneSegment
impl RefUnwindSafe for ZoneSegment
impl !Send for ZoneSegment
impl !Sync for ZoneSegment
impl Unpin for ZoneSegment
impl UnsafeUnpin for ZoneSegment
impl UnwindSafe for ZoneSegment
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more