From fbb33c68f6b51bb00711ffebb2d8a31af7ad1610 Mon Sep 17 00:00:00 2001 From: Pekka Pirinen Date: Wed, 10 Jun 1998 19:44:34 +0100 Subject: [PATCH] Move update of trace->condemned to the pools (change.dylan.crow.160064.3) Copied from Perforce Change: 19668 ServerID: perforce.ravenbrook.com --- mps/src/poolamc.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/mps/src/poolamc.c b/mps/src/poolamc.c index 25422639207..bc8c0a7add5 100644 --- a/mps/src/poolamc.c +++ b/mps/src/poolamc.c @@ -1,6 +1,6 @@ /* impl.c.poolamc: AUTOMATIC MOSTLY-COPYING MEMORY POOL CLASS * - * $HopeName: MMsrc!poolamc.c(trunk.7) $ + * $HopeName: MMsrc!poolamc.c(trunk.8) $ * Copyright (C) 1998. Harlequin Group plc. All rights reserved. * * .sources: design.mps.poolamc. @@ -10,7 +10,7 @@ #include "mpscamc.h" #include "mpm.h" -SRCID(poolamc, "$HopeName: MMsrc!poolamc.c(trunk.7) $"); +SRCID(poolamc, "$HopeName: MMsrc!poolamc.c(trunk.8) $"); /* PType enumeration -- distinguishes AMCGen and AMCNailBoard */ @@ -671,7 +671,7 @@ static double AMCBenefit(Pool pool, Action action) } -/* AMCWhiten -- turn the segment white for the traces +/* AMCWhiten -- condemn the segment for the trace * * If the segment has a mutator buffer on it, we nail the buffer, * because we can't scan or reclaim uncommitted buffers. @@ -727,10 +727,15 @@ static Res AMCWhiten(Pool pool, Trace trace, Seg seg) /* Nail it for this trace as well. */ SegSetNailed(seg, TraceSetAdd(SegNailed(seg), trace->ti)); } + /* We didn't condemn the buffer, subtract it from the count. */ + /* @@@@ We could subtract all the nailed grains. */ + trace->condemned -= AddrOffset(BufferScanLimit(buffer), + BufferLimit(buffer)); } } } + trace->condemned += SegSize(seg); SegSetWhite(seg, TraceSetAdd(SegWhite(seg), trace->ti)); gen = AMCSegGen(seg);