#[repr(C)]pub struct PageData {
pub data: [u8; 4096],
pub perm: [Perm; 4096],
}Expand description
One guest page: its bytes, and one permission bitset per byte.
The two arrays are one allocation, in this order, with no padding between
them, because that layout is an interface: compiled code reaches a page
through a cached host pointer to data and finds the permission byte for
data[i] at PAGE_PERM_OFFSET + i from it. Two separate Boxes would mean
a second cached pointer per page, or a second load per access.
Fields§
§data: [u8; 4096]§perm: [Perm; 4096]Trait Implementations§
Auto Trait Implementations§
impl Freeze for PageData
impl RefUnwindSafe for PageData
impl Send for PageData
impl Sync for PageData
impl Unpin for PageData
impl UnsafeUnpin for PageData
impl UnwindSafe for PageData
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