File tree Expand file tree Collapse file tree 11 files changed +8
-39
lines changed
docs/userguide/src/tutorial/code/mygc_semispace Expand file tree Collapse file tree 11 files changed +8
-39
lines changed Original file line number Diff line number Diff line change 1
1
// ANCHOR: imports_no_gc_work
2
2
use crate :: plan:: global:: BasePlan ; //Modify
3
3
use crate :: plan:: global:: CommonPlan ; // Add
4
- use crate :: plan:: global:: GcStatus ; // Add
5
4
use crate :: plan:: global:: { CreateGeneralPlanArgs , CreateSpecificPlanArgs } ;
6
5
use crate :: plan:: mygc:: mutator:: ALLOCATOR_MAPPING ;
7
6
use crate :: plan:: mygc:: gc_work:: MyGCWorkContext ;
@@ -77,8 +76,6 @@ impl<VM: VMBinding> Plan for MyGC<VM> {
77
76
// Modify
78
77
// ANCHOR: schedule_collection
79
78
fn schedule_collection ( & ' static self , scheduler : & GCWorkScheduler < VM > ) {
80
- self . base ( ) . set_collection_kind :: < Self > ( self ) ;
81
- self . base ( ) . set_gc_status ( GcStatus :: GcPrepare ) ;
82
79
scheduler. schedule_common_work :: < MyGCWorkContext < VM > > ( self ) ;
83
80
}
84
81
// ANCHOR_END: schedule_collection
Original file line number Diff line number Diff line change @@ -8,7 +8,6 @@ use crate::plan::global::BasePlan;
8
8
use crate :: plan:: global:: CommonPlan ;
9
9
use crate :: plan:: global:: CreateGeneralPlanArgs ;
10
10
use crate :: plan:: global:: CreateSpecificPlanArgs ;
11
- use crate :: plan:: global:: GcStatus ;
12
11
use crate :: plan:: AllocationSemantics ;
13
12
use crate :: plan:: Plan ;
14
13
use crate :: plan:: PlanConstraints ;
@@ -73,8 +72,6 @@ impl<VM: VMBinding> Plan for GenCopy<VM> {
73
72
74
73
fn schedule_collection ( & ' static self , scheduler : & GCWorkScheduler < VM > ) {
75
74
let is_full_heap = self . requires_full_heap_collection ( ) ;
76
- self . base ( ) . set_collection_kind :: < Self > ( self ) ;
77
- self . base ( ) . set_gc_status ( GcStatus :: GcPrepare ) ;
78
75
if is_full_heap {
79
76
scheduler. schedule_common_work :: < GenCopyGCWorkContext < VM > > ( self ) ;
80
77
} else {
Original file line number Diff line number Diff line change @@ -6,7 +6,6 @@ use crate::plan::global::BasePlan;
6
6
use crate :: plan:: global:: CommonPlan ;
7
7
use crate :: plan:: global:: CreateGeneralPlanArgs ;
8
8
use crate :: plan:: global:: CreateSpecificPlanArgs ;
9
- use crate :: plan:: global:: GcStatus ;
10
9
use crate :: plan:: AllocationSemantics ;
11
10
use crate :: plan:: Plan ;
12
11
use crate :: plan:: PlanConstraints ;
@@ -104,10 +103,6 @@ impl<VM: VMBinding> Plan for GenImmix<VM> {
104
103
#[ allow( clippy:: branches_sharing_code) ]
105
104
fn schedule_collection ( & ' static self , scheduler : & GCWorkScheduler < Self :: VM > ) {
106
105
let is_full_heap = self . requires_full_heap_collection ( ) ;
107
-
108
- self . base ( ) . set_collection_kind :: < Self > ( self ) ;
109
- self . base ( ) . set_gc_status ( GcStatus :: GcPrepare ) ;
110
-
111
106
if !is_full_heap {
112
107
debug ! ( "Nursery GC" ) ;
113
108
scheduler. schedule_common_work :: < GenImmixNurseryGCWorkContext < VM > > ( self ) ;
Original file line number Diff line number Diff line change @@ -691,7 +691,7 @@ impl<VM: VMBinding> BasePlan<VM> {
691
691
self . vm_space . release ( ) ;
692
692
}
693
693
694
- pub fn set_collection_kind < P : Plan > ( & self , plan : & P ) {
694
+ pub fn set_collection_kind ( & self , plan : & dyn Plan < VM = VM > ) {
695
695
self . cur_collection_attempts . store (
696
696
if self . is_user_triggered_collection ( ) {
697
697
1
Original file line number Diff line number Diff line change @@ -4,7 +4,6 @@ use crate::plan::global::BasePlan;
4
4
use crate :: plan:: global:: CommonPlan ;
5
5
use crate :: plan:: global:: CreateGeneralPlanArgs ;
6
6
use crate :: plan:: global:: CreateSpecificPlanArgs ;
7
- use crate :: plan:: global:: GcStatus ;
8
7
use crate :: plan:: AllocationSemantics ;
9
8
use crate :: plan:: Plan ;
10
9
use crate :: plan:: PlanConstraints ;
@@ -73,8 +72,6 @@ impl<VM: VMBinding> Plan for Immix<VM> {
73
72
}
74
73
75
74
fn schedule_collection ( & ' static self , scheduler : & GCWorkScheduler < VM > ) {
76
- self . base ( ) . set_collection_kind :: < Self > ( self ) ;
77
- self . base ( ) . set_gc_status ( GcStatus :: GcPrepare ) ;
78
75
Self :: schedule_immix_full_heap_collection :: <
79
76
Immix < VM > ,
80
77
ImmixGCWorkContext < VM , TRACE_KIND_FAST > ,
Original file line number Diff line number Diff line change @@ -4,7 +4,6 @@ use super::gc_work::{
4
4
UpdateReferences ,
5
5
} ;
6
6
use crate :: plan:: global:: CommonPlan ;
7
- use crate :: plan:: global:: GcStatus ;
8
7
use crate :: plan:: global:: { BasePlan , CreateGeneralPlanArgs , CreateSpecificPlanArgs } ;
9
8
use crate :: plan:: markcompact:: mutator:: ALLOCATOR_MAPPING ;
10
9
use crate :: plan:: AllocationSemantics ;
@@ -80,9 +79,6 @@ impl<VM: VMBinding> Plan for MarkCompact<VM> {
80
79
}
81
80
82
81
fn schedule_collection ( & ' static self , scheduler : & GCWorkScheduler < VM > ) {
83
- self . base ( ) . set_collection_kind :: < Self > ( self ) ;
84
- self . base ( ) . set_gc_status ( GcStatus :: GcPrepare ) ;
85
-
86
82
// TODO use schedule_common once it can work with markcompact
87
83
// self.common()
88
84
// .schedule_common::<Self, MarkingProcessEdges<VM>, NoCopy<VM>>(
Original file line number Diff line number Diff line change @@ -2,7 +2,6 @@ use crate::plan::global::BasePlan;
2
2
use crate :: plan:: global:: CommonPlan ;
3
3
use crate :: plan:: global:: CreateGeneralPlanArgs ;
4
4
use crate :: plan:: global:: CreateSpecificPlanArgs ;
5
- use crate :: plan:: global:: GcStatus ;
6
5
use crate :: plan:: marksweep:: gc_work:: MSGCWorkContext ;
7
6
use crate :: plan:: marksweep:: mutator:: ALLOCATOR_MAPPING ;
8
7
use crate :: plan:: AllocationSemantics ;
@@ -50,8 +49,6 @@ pub const MS_CONSTRAINTS: PlanConstraints = PlanConstraints {
50
49
51
50
impl < VM : VMBinding > Plan for MarkSweep < VM > {
52
51
fn schedule_collection ( & ' static self , scheduler : & GCWorkScheduler < VM > ) {
53
- self . base ( ) . set_collection_kind :: < Self > ( self ) ;
54
- self . base ( ) . set_gc_status ( GcStatus :: GcPrepare ) ;
55
52
scheduler. schedule_common_work :: < MSGCWorkContext < VM > > ( self ) ;
56
53
}
57
54
Original file line number Diff line number Diff line change @@ -2,7 +2,6 @@ use super::gc_work::PPGCWorkContext;
2
2
use super :: mutator:: ALLOCATOR_MAPPING ;
3
3
use crate :: plan:: global:: CreateGeneralPlanArgs ;
4
4
use crate :: plan:: global:: CreateSpecificPlanArgs ;
5
- use crate :: plan:: global:: GcStatus ;
6
5
use crate :: plan:: AllocationSemantics ;
7
6
use crate :: plan:: Plan ;
8
7
use crate :: plan:: PlanConstraints ;
@@ -40,8 +39,6 @@ impl<VM: VMBinding> Plan for PageProtect<VM> {
40
39
}
41
40
42
41
fn schedule_collection ( & ' static self , scheduler : & GCWorkScheduler < VM > ) {
43
- self . base ( ) . set_collection_kind :: < Self > ( self ) ;
44
- self . base ( ) . set_gc_status ( GcStatus :: GcPrepare ) ;
45
42
scheduler. schedule_common_work :: < PPGCWorkContext < VM > > ( self ) ;
46
43
}
47
44
Original file line number Diff line number Diff line change @@ -2,7 +2,6 @@ use super::gc_work::SSGCWorkContext;
2
2
use crate :: plan:: global:: CommonPlan ;
3
3
use crate :: plan:: global:: CreateGeneralPlanArgs ;
4
4
use crate :: plan:: global:: CreateSpecificPlanArgs ;
5
- use crate :: plan:: global:: GcStatus ;
6
5
use crate :: plan:: semispace:: mutator:: ALLOCATOR_MAPPING ;
7
6
use crate :: plan:: AllocationSemantics ;
8
7
use crate :: plan:: Plan ;
@@ -67,8 +66,6 @@ impl<VM: VMBinding> Plan for SemiSpace<VM> {
67
66
}
68
67
69
68
fn schedule_collection ( & ' static self , scheduler : & GCWorkScheduler < VM > ) {
70
- self . base ( ) . set_collection_kind :: < Self > ( self ) ;
71
- self . base ( ) . set_gc_status ( GcStatus :: GcPrepare ) ;
72
69
scheduler. schedule_common_work :: < SSGCWorkContext < VM > > ( self ) ;
73
70
}
74
71
Original file line number Diff line number Diff line change @@ -3,7 +3,6 @@ use crate::plan::global::CommonPlan;
3
3
use crate :: plan:: global:: CreateGeneralPlanArgs ;
4
4
use crate :: plan:: global:: CreateSpecificPlanArgs ;
5
5
use crate :: plan:: immix;
6
- use crate :: plan:: GcStatus ;
7
6
use crate :: plan:: PlanConstraints ;
8
7
use crate :: policy:: immix:: ImmixSpace ;
9
8
use crate :: policy:: sft:: SFT ;
@@ -80,9 +79,6 @@ impl<VM: VMBinding> Plan for StickyImmix<VM> {
80
79
}
81
80
82
81
fn schedule_collection ( & ' static self , scheduler : & crate :: scheduler:: GCWorkScheduler < Self :: VM > ) {
83
- self . base ( ) . set_collection_kind :: < Self > ( self ) ;
84
- self . base ( ) . set_gc_status ( GcStatus :: GcPrepare ) ;
85
-
86
82
let is_full_heap = self . requires_full_heap_collection ( ) ;
87
83
self . gc_full_heap . store ( is_full_heap, Ordering :: SeqCst ) ;
88
84
You can’t perform that action at this time.
0 commit comments