mmtk 0.16.0

MMTk is a framework for the design and implementation of high-performance and portable memory managers.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use crate::util::ObjectReference;
use crate::vm::VMBinding;
use crate::vm::VMLocalMarkBitSpec;
use std::sync::atomic::Ordering;

impl VMLocalMarkBitSpec {
    /// Set the mark bit for the object to 1
    pub fn mark<VM: VMBinding>(&self, object: ObjectReference, ordering: Ordering) {
        self.store_atomic::<VM, u8>(object, 1, None, ordering);
    }

    /// Test if the mark bit for the object is set (1)
    pub fn is_marked<VM: VMBinding>(&self, object: ObjectReference, ordering: Ordering) -> bool {
        self.load_atomic::<VM, u8>(object, None, ordering) == 1
    }
}