Trait mmtk::plan::generational::global::GenerationalPlan
source · pub trait GenerationalPlan: Plan {
// Required methods
fn is_current_gc_nursery(&self) -> bool;
fn is_object_in_nursery(&self, object: ObjectReference) -> bool;
fn is_address_in_nursery(&self, addr: Address) -> bool;
fn get_mature_physical_pages_available(&self) -> usize;
fn get_mature_reserved_pages(&self) -> usize;
fn last_collection_full_heap(&self) -> bool;
fn force_full_heap_collection(&self);
}
Expand description
This trait includes methods that are specific to generational plans. This trait needs to be object safe.
Required Methods§
sourcefn is_current_gc_nursery(&self) -> bool
fn is_current_gc_nursery(&self) -> bool
Is the current GC a nursery GC? If a GC is not a nursery GC, it will be a full heap GC. This should only be called during GC.
sourcefn is_object_in_nursery(&self, object: ObjectReference) -> bool
fn is_object_in_nursery(&self, object: ObjectReference) -> bool
Is the object in the nursery?
sourcefn is_address_in_nursery(&self, addr: Address) -> bool
fn is_address_in_nursery(&self, addr: Address) -> bool
Is the address in the nursery? As we only know addresses rather than object references, the
implementation cannot access per-object metadata. If the plan does not have knowledge whether
the address is in nursery or not (e.g. mature/nursery objects share the same space and are
only differentiated by object metadata), the implementation should return false
as a more
conservative result.
sourcefn get_mature_physical_pages_available(&self) -> usize
fn get_mature_physical_pages_available(&self) -> usize
Return the number of pages available for allocation into the mature space.
sourcefn get_mature_reserved_pages(&self) -> usize
fn get_mature_reserved_pages(&self) -> usize
Return the number of used pages in the mature space.
sourcefn last_collection_full_heap(&self) -> bool
fn last_collection_full_heap(&self) -> bool
Return whether last GC is a full GC.
sourcefn force_full_heap_collection(&self)
fn force_full_heap_collection(&self)
Force the next collection to be full heap.