@@ -29,7 +29,9 @@ use crate::vm::VMBinding;
2929use std:: cell:: UnsafeCell ;
3030use std:: collections:: HashMap ;
3131use std:: default:: Default ;
32- use std:: sync:: atomic:: { AtomicBool , Ordering } ;
32+ #[ cfg( feature = "sanity" ) ]
33+ use std:: sync:: atomic:: AtomicBool ;
34+ use std:: sync:: atomic:: Ordering ;
3335use std:: sync:: Arc ;
3436use std:: sync:: Mutex ;
3537
@@ -123,7 +125,6 @@ pub struct MMTK<VM: VMBinding> {
123125 pub ( crate ) gc_trigger : Arc < GCTrigger < VM > > ,
124126 pub ( crate ) gc_requester : Arc < GCRequester < VM > > ,
125127 pub ( crate ) stats : Arc < Stats > ,
126- inside_harness : AtomicBool ,
127128 #[ cfg( feature = "sanity" ) ]
128129 inside_sanity : AtomicBool ,
129130 /// Analysis counters. The feature analysis allows us to periodically stop the world and collect some statistics.
@@ -220,7 +221,6 @@ impl<VM: VMBinding> MMTK<VM> {
220221 sanity_checker : Mutex :: new ( SanityChecker :: new ( ) ) ,
221222 #[ cfg( feature = "sanity" ) ]
222223 inside_sanity : AtomicBool :: new ( false ) ,
223- inside_harness : AtomicBool :: new ( false ) ,
224224 #[ cfg( feature = "extreme_assertions" ) ]
225225 slot_logger : SlotLogger :: new ( ) ,
226226 #[ cfg( feature = "analysis" ) ]
@@ -324,7 +324,7 @@ impl<VM: VMBinding> MMTK<VM> {
324324 pub fn harness_begin ( & self , tls : VMMutatorThread ) {
325325 probe ! ( mmtk, harness_begin) ;
326326 self . handle_user_collection_request ( tls, true , true ) ;
327- self . inside_harness . store ( true , Ordering :: SeqCst ) ;
327+ self . state . inside_harness . store ( true , Ordering :: SeqCst ) ;
328328 self . stats . start_all ( ) ;
329329 self . scheduler . enable_stat ( ) ;
330330 }
@@ -334,7 +334,7 @@ impl<VM: VMBinding> MMTK<VM> {
334334 /// This is usually called by the benchmark harness right after the actual benchmark.
335335 pub fn harness_end ( & ' static self ) {
336336 self . stats . stop_all ( self ) ;
337- self . inside_harness . store ( false , Ordering :: SeqCst ) ;
337+ self . state . inside_harness . store ( false , Ordering :: SeqCst ) ;
338338 probe ! ( mmtk, harness_end) ;
339339 }
340340
0 commit comments