Trait memory::PageSize

pub trait PageSize: Ord + PartialOrd<Self> + Clone + Copy + Sealed + 'static {
    const SIZE: MemChunkSize;
    const NUM_4K_PAGES: usize;
    const SIZE_IN_BYTES: usize;
}
Expand description

Trait that represents the size of a page or frame, i.e., for normal or huge pages.

This is used to parameterize Page- and Frame-related types with a page size, in order to define normal and huge pages in a generic manner.

Required Associated Constants§

Implementors§

§

impl PageSize for Page1G

§

const SIZE: MemChunkSize = MemChunkSize::Huge1G

§

const NUM_4K_PAGES: usize = 262_144usize

§

const SIZE_IN_BYTES: usize = 1_073_741_824usize

§

impl PageSize for Page2M

§

const SIZE: MemChunkSize = MemChunkSize::Huge2M

§

const NUM_4K_PAGES: usize = 512usize

§

const SIZE_IN_BYTES: usize = 2_097_152usize

§

impl PageSize for Page4K

§

const SIZE: MemChunkSize = MemChunkSize::Normal4K

§

const NUM_4K_PAGES: usize = 1usize

§

const SIZE_IN_BYTES: usize = 4_096usize