File tree Expand file tree Collapse file tree 3 files changed +10
-5
lines changed Expand file tree Collapse file tree 3 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -95,7 +95,12 @@ static void report(void)
9595
9696static mps_addr_t make (size_t rootsCount )
9797{
98- static unsigned long calls = 0 ;
98+ /* The calls variable is useful when debugging to stop the debugging
99+ after a certain number of allocations using a debugger
100+ "watchpoint". Allocations are a good "clock tick" for this test.
101+ The test itself doesn't use the variable, so we declare it
102+ volatile, which also forces updates into memory. */
103+ static volatile unsigned long calls = 0 ;
99104 size_t length = rnd () % (scale * avLEN );
100105 size_t size = (length + 2 ) * sizeof (mps_word_t );
101106 mps_addr_t p ;
Original file line number Diff line number Diff line change @@ -1057,7 +1057,7 @@ static void awlSegReclaim(Seg seg, Trace trace)
10571057 Bool hasBuffer = SegBuffer (& buffer , seg );
10581058 Format format = pool -> format ;
10591059 Count reclaimedGrains = (Count )0 ;
1060- Count preservedInPlaceCount = (Count )0 ;
1060+ STATISTIC_DECL ( Count preservedInPlaceCount = (Count )0 )
10611061 Size preservedInPlaceSize = (Size )0 ;
10621062 Index i ;
10631063
@@ -1089,7 +1089,7 @@ static void awlSegReclaim(Seg seg, Trace trace)
10891089 AVER (BTGet (awlseg -> scanned , i ));
10901090 BTSetRange (awlseg -> mark , i , j );
10911091 BTSetRange (awlseg -> scanned , i , j );
1092- ++ preservedInPlaceCount ;
1092+ STATISTIC ( ++ preservedInPlaceCount ) ;
10931093 preservedInPlaceSize += AddrOffset (p , q );
10941094 } else {
10951095 BTResRange (awlseg -> mark , i , j );
Original file line number Diff line number Diff line change @@ -313,7 +313,7 @@ static void loSegReclaim(Seg seg, Trace trace)
313313 Bool hasBuffer = SegBuffer (& buffer , seg );
314314 Count reclaimedGrains = (Count )0 ;
315315 Format format = NULL ; /* suppress "may be used uninitialized" warning */
316- Count preservedInPlaceCount = (Count )0 ;
316+ STATISTIC_DECL ( Count preservedInPlaceCount = (Count )0 )
317317 Size preservedInPlaceSize = (Size )0 ;
318318 Bool b ;
319319
@@ -355,7 +355,7 @@ static void loSegReclaim(Seg seg, Trace trace)
355355 q = (* format -> skip )(AddrAdd (p , format -> headerSize ));
356356 q = AddrSub (q , format -> headerSize );
357357 if (BTGet (loseg -> mark , i )) {
358- ++ preservedInPlaceCount ;
358+ STATISTIC ( ++ preservedInPlaceCount ) ;
359359 preservedInPlaceSize += AddrOffset (p , q );
360360 } else {
361361 Index j = PoolIndexOfAddr (base , pool , q );
You can’t perform that action at this time.
0 commit comments