diff --git a/code/amcss.c b/code/amcss.c index f0b477ecb5..018211054b 100644 --- a/code/amcss.c +++ b/code/amcss.c @@ -95,7 +95,12 @@ static void report(void) static mps_addr_t make(size_t rootsCount) { - static unsigned long calls = 0; + /* The calls variable is useful when debugging to stop the debugging + after a certain number of allocations using a debugger + "watchpoint". Allocations are a good "clock tick" for this test. + The test itself doesn't use the variable, so we declare it + volatile, which also forces updates into memory. */ + static volatile unsigned long calls = 0; size_t length = rnd() % (scale * avLEN); size_t size = (length+2) * sizeof(mps_word_t); mps_addr_t p; diff --git a/code/poolawl.c b/code/poolawl.c index 3808c608a8..b9c15b9838 100644 --- a/code/poolawl.c +++ b/code/poolawl.c @@ -1057,7 +1057,7 @@ static void awlSegReclaim(Seg seg, Trace trace) Bool hasBuffer = SegBuffer(&buffer, seg); Format format = pool->format; Count reclaimedGrains = (Count)0; - Count preservedInPlaceCount = (Count)0; + STATISTIC_DECL(Count preservedInPlaceCount = (Count)0) Size preservedInPlaceSize = (Size)0; Index i; @@ -1089,7 +1089,7 @@ static void awlSegReclaim(Seg seg, Trace trace) AVER(BTGet(awlseg->scanned, i)); BTSetRange(awlseg->mark, i, j); BTSetRange(awlseg->scanned, i, j); - ++preservedInPlaceCount; + STATISTIC(++preservedInPlaceCount); preservedInPlaceSize += AddrOffset(p, q); } else { BTResRange(awlseg->mark, i, j); diff --git a/code/poollo.c b/code/poollo.c index 25295e604c..af72a50a8f 100644 --- a/code/poollo.c +++ b/code/poollo.c @@ -313,7 +313,7 @@ static void loSegReclaim(Seg seg, Trace trace) Bool hasBuffer = SegBuffer(&buffer, seg); Count reclaimedGrains = (Count)0; Format format = NULL; /* supress "may be used uninitialized" warning */ - Count preservedInPlaceCount = (Count)0; + STATISTIC_DECL(Count preservedInPlaceCount = (Count)0) Size preservedInPlaceSize = (Size)0; Bool b; @@ -355,7 +355,7 @@ static void loSegReclaim(Seg seg, Trace trace) q = (*format->skip)(AddrAdd(p, format->headerSize)); q = AddrSub(q, format->headerSize); if(BTGet(loseg->mark, i)) { - ++preservedInPlaceCount; + STATISTIC(++preservedInPlaceCount); preservedInPlaceSize += AddrOffset(p, q); } else { Index j = PoolIndexOfAddr(base, pool, q);