mmtk/plan/
gc_work.rs

1//! This module holds work packets for `CommonPlan` and `BasePlan`, or other work packets not
2//! directly related to scheduling.
3
4use crate::{plan::global::CommonPlan, scheduler::GCWork, vm::VMBinding};
5
6pub(super) struct SetCommonPlanUnlogBits<VM: VMBinding> {
7    pub common_plan: &'static CommonPlan<VM>,
8}
9
10impl<VM: VMBinding> GCWork<VM> for SetCommonPlanUnlogBits<VM> {
11    fn do_work(
12        &mut self,
13        _worker: &mut crate::scheduler::GCWorker<VM>,
14        _mmtk: &'static crate::MMTK<VM>,
15    ) {
16        self.common_plan.set_side_log_bits();
17    }
18}
19
20pub(super) struct ClearCommonPlanUnlogBits<VM: VMBinding> {
21    pub common_plan: &'static CommonPlan<VM>,
22}
23
24impl<VM: VMBinding> GCWork<VM> for ClearCommonPlanUnlogBits<VM> {
25    fn do_work(
26        &mut self,
27        _worker: &mut crate::scheduler::GCWorker<VM>,
28        _mmtk: &'static crate::MMTK<VM>,
29    ) {
30        self.common_plan.clear_side_log_bits();
31    }
32}