Skip to content

Commit 6f79aea

Browse files
committed
GCWorkContext should always have 'static and Send
1 parent b414746 commit 6f79aea

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

src/plan/immix/global.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,8 @@ impl<VM: VMBinding> Immix<VM> {
173173
/// to schedule a full heap collection. A plan must call set_collection_kind and set_gc_status before this method.
174174
pub(crate) fn schedule_immix_full_heap_collection<
175175
PlanType: Plan<VM = VM>,
176-
FastContext: Send + 'static + GCWorkContext<VM = VM, PlanType = PlanType>,
177-
DefragContext: Send + 'static + GCWorkContext<VM = VM, PlanType = PlanType>,
176+
FastContext: GCWorkContext<VM = VM, PlanType = PlanType>,
177+
DefragContext: GCWorkContext<VM = VM, PlanType = PlanType>,
178178
>(
179179
plan: &'static DefragContext::PlanType,
180180
immix_space: &ImmixSpace<VM>,

src/scheduler/gc_work.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ impl<C: GCWorkContext> Prepare<C> {
4242
}
4343
}
4444

45-
impl<C: GCWorkContext + 'static> GCWork<C::VM> for Prepare<C> {
45+
impl<C: GCWorkContext> GCWork<C::VM> for Prepare<C> {
4646
fn do_work(&mut self, worker: &mut GCWorker<C::VM>, mmtk: &'static MMTK<C::VM>) {
4747
trace!("Prepare Global");
4848
// We assume this is the only running work packet that accesses plan at the point of execution
@@ -110,7 +110,7 @@ impl<C: GCWorkContext> Release<C> {
110110
}
111111
}
112112

113-
impl<C: GCWorkContext + 'static> GCWork<C::VM> for Release<C> {
113+
impl<C: GCWorkContext> GCWork<C::VM> for Release<C> {
114114
fn do_work(&mut self, worker: &mut GCWorker<C::VM>, mmtk: &'static MMTK<C::VM>) {
115115
trace!("Release Global");
116116

@@ -187,7 +187,7 @@ impl<C: GCWorkContext> StopMutators<C> {
187187
}
188188
}
189189

190-
impl<C: GCWorkContext + Send + 'static> GCWork<C::VM> for StopMutators<C> {
190+
impl<C: GCWorkContext> GCWork<C::VM> for StopMutators<C> {
191191
fn do_work(&mut self, worker: &mut GCWorker<C::VM>, mmtk: &'static MMTK<C::VM>) {
192192
trace!("stop_all_mutators start");
193193
mmtk.plan.base().prepare_for_stack_scanning();
@@ -445,7 +445,7 @@ impl<VM: VMBinding> GCWork<VM> for VMPostForwarding<VM> {
445445

446446
pub struct ScanMutatorRoots<C: GCWorkContext>(pub &'static mut Mutator<C::VM>);
447447

448-
impl<C: GCWorkContext + 'static> GCWork<C::VM> for ScanMutatorRoots<C> {
448+
impl<C: GCWorkContext> GCWork<C::VM> for ScanMutatorRoots<C> {
449449
fn do_work(&mut self, worker: &mut GCWorker<C::VM>, mmtk: &'static MMTK<C::VM>) {
450450
trace!("ScanMutatorRoots for mutator {:?}", self.0.get_tls());
451451
let base = &mmtk.plan.base();
@@ -480,7 +480,7 @@ impl<C: GCWorkContext> ScanVMSpecificRoots<C> {
480480
}
481481
}
482482

483-
impl<C: GCWorkContext + Send + 'static> GCWork<C::VM> for ScanVMSpecificRoots<C> {
483+
impl<C: GCWorkContext> GCWork<C::VM> for ScanVMSpecificRoots<C> {
484484
fn do_work(&mut self, worker: &mut GCWorker<C::VM>, mmtk: &'static MMTK<C::VM>) {
485485
trace!("ScanStaticRoots");
486486
let factory = ProcessEdgesWorkRootsWorkFactory::<

src/scheduler/work.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ use crate::plan::Plan;
5050
/// needs this trait to schedule different work packets. For certain plans,
5151
/// they may need to provide several types that implement this trait, e.g. one for
5252
/// nursery GC, one for mature GC.
53-
pub trait GCWorkContext {
53+
pub trait GCWorkContext: Send + 'static {
5454
type VM: VMBinding;
5555
type PlanType: Plan<VM = Self::VM>;
5656
// We should use SFTProcessEdges as the default value for this associate type. However, this requires

0 commit comments

Comments
 (0)