pub struct LuaPage { /* private fields */ }Expand description
Non-owning identity of a VM allocation page.
§Safety model for unsafe methods
The page and its allocation must remain live. Block sizes, offsets, and traversal metadata must match the page class; page-list or allocator mutation can invalidate the handle and every pointer derived from it.
Implementations§
Source§impl LuaPage
impl LuaPage
pub const unsafe fn from_raw(raw: NonNull<RawLuaPage>) -> Self
pub fn data_ptr(&self) -> *const u8
pub fn data_ptr_mut(&self) -> *mut u8
Sourcepub unsafe fn block(&self, offset: i32) -> *mut u8
pub unsafe fn block(&self, offset: i32) -> *mut u8
Returns a block address at offset bytes from the page data.
§Safety
offset must be non-negative, aligned for the page’s block layout, and
identify a complete block within this page’s allocation.
pub fn page_blocks(&self) -> i32
Sourcepub unsafe fn metadata_slot(block: *mut u8) -> *mut *mut u8
pub unsafe fn metadata_slot(block: *mut u8) -> *mut *mut u8
§Safety
block must address a live allocator block whose leading storage is a
pointer-sized metadata slot.
Sourcepub unsafe fn free_gco_link_slot(block: *mut u8) -> *mut *mut u8
pub unsafe fn free_gco_link_slot(block: *mut u8) -> *mut *mut u8
§Safety
block must address a live GC block large enough to contain the
collector free-list link at GCO_LINK_OFFSET.
pub unsafe fn gco_walk(&self) -> (GcoPageWalk, i32)
Trait Implementations§
impl Copy for LuaPage
impl Eq for LuaPage
impl StructuralPartialEq for LuaPage
Auto Trait Implementations§
impl !Send for LuaPage
impl !Sync for LuaPage
impl Freeze for LuaPage
impl RefUnwindSafe for LuaPage
impl Unpin for LuaPage
impl UnsafeUnpin for LuaPage
impl UnwindSafe for LuaPage
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