File tree 1 file changed +17
-6
lines changed
1 file changed +17
-6
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,14 @@ struct SillyIterator<'a>{
16
16
phantom_data : PhantomData < & ' a ( ) > ,
17
17
}
18
18
19
+ impl < ' a > Iterator for SillyIterator < ' a > {
20
+ type Item = & ' a mut Mutator < DummyVM > ;
21
+
22
+ fn next ( & mut self ) -> Option < Self :: Item > {
23
+ self . mutators . pop_front ( )
24
+ }
25
+ }
26
+
19
27
// Documentation: https://docs.mmtk.io/api/mmtk/vm/active_plan/trait.ActivePlan.html
20
28
impl ActivePlan < DummyVM > for VMActivePlan {
21
29
fn number_of_mutators ( ) -> usize {
@@ -33,15 +41,18 @@ impl ActivePlan<DummyVM> for VMActivePlan {
33
41
34
42
fn mutators < ' a > ( ) -> Box < dyn Iterator < Item = & ' a mut Mutator < DummyVM > > + ' a > {
35
43
let mut new_mutators = VecDeque :: new ( ) ;
44
+ let null_mutator : * mut Mutator < DummyVM > = ptr:: null_mut ( ) ;
45
+
46
+ if !null_mutator. is_null ( ) {
47
+ unsafe {
48
+ new_mutators. push_back ( & mut * null_mutator) ;
49
+ }
50
+ }
36
51
37
- let null_mutator : * mut Mutator < DummyVM > = ptr:: null_mut ( ) ;
38
- new_mutators. push_back ( unsafe { & mut * null_mutator} ) ;
39
-
40
52
Box :: new ( SillyIterator {
41
53
mutators : new_mutators,
42
54
phantom_data : PhantomData ,
43
- } ) ;
55
+ } )
44
56
45
- unimplemented ! ( )
46
57
}
47
- }
58
+ }
You can’t perform that action at this time.
0 commit comments