pub struct CardTable { /* private fields */ }Expand description
Card table for tracking old→young pointers.
Each byte covers a 512-byte region of memory. When a store into an old-gen object writes a pointer to a young-gen object, the corresponding card byte is set to 1 (dirty).
Implementations§
Source§impl CardTable
impl CardTable
Sourcepub fn new(base: usize, size: usize) -> Self
pub fn new(base: usize, size: usize) -> Self
Create a card table covering size bytes starting at base.
Sourcepub fn mark_dirty(&mut self, addr: usize)
pub fn mark_dirty(&mut self, addr: usize)
Mark the card containing addr as dirty.
Sourcepub fn for_each_dirty(&self, f: impl FnMut(usize, usize))
pub fn for_each_dirty(&self, f: impl FnMut(usize, usize))
Iterate over dirty card ranges. Calls f(start_addr, end_addr) for each dirty card.
Sourcepub fn dirty_count(&self) -> usize
pub fn dirty_count(&self) -> usize
Number of dirty cards.
Sourcepub fn covered_size(&self) -> usize
pub fn covered_size(&self) -> usize
Get the total size covered by this card table.
Auto Trait Implementations§
impl Freeze for CardTable
impl RefUnwindSafe for CardTable
impl Send for CardTable
impl Sync for CardTable
impl Unpin for CardTable
impl UnsafeUnpin for CardTable
impl UnwindSafe for CardTable
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