Trait mmtk::util::object_enum::BlockMayHaveObjects
source · pub(crate) trait BlockMayHaveObjects: Region {
// Required method
fn may_have_objects(&self) -> bool;
}
Expand description
Allow querying if a block may have objects. MarkSweepSpace
and ImmixSpace
use different
Block
types, and they have different block states. This trait lets both Block
types provide
the same may_have_objects
method.
Required Methods§
sourcefn may_have_objects(&self) -> bool
fn may_have_objects(&self) -> bool
Return true
if the block may contain valid objects (objects with the VO bit set). Return
false
otherwise.
This function is used during object enumeration to filter out memory regions that do not
contain objects. Because object enumeration may happen at mutator time, and another mutators
may be allocating objects, this function only needs to reflect the state of the block at the
time of calling, and is allowed to conservatively return true
.
Object Safety§
This trait is not object safe.