From 3877fc376226d6cd3b32f896ca82bf595eaa0cff Mon Sep 17 00:00:00 2001 From: Richard Kistruck Date: Thu, 19 Jul 2007 16:50:21 +0100 Subject: [PATCH] Mps master: trace and poolabs: (comment only) clarify that PoolTrivGrey knows that a white seg is an all-white seg, and therefore needs no greying. Copied from Perforce Change: 162946 ServerID: perforce.ravenbrook.com --- mps/code/poolabs.c | 8 ++++++-- mps/code/trace.c | 3 +++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/mps/code/poolabs.c b/mps/code/poolabs.c index 95e45a9b73a..69d916e6378 100644 --- a/mps/code/poolabs.c +++ b/mps/code/poolabs.c @@ -470,8 +470,12 @@ void PoolTrivGrey(Pool pool, Trace trace, Seg seg) AVERT(Trace, trace); AVERT(Seg, seg); - /* @@@@ The trivial grey method probably shouldn't exclude */ - /* the white segments, since they might also contain grey objects. */ + /* If we had a (partially) white seg, then other parts of the */ + /* same seg might need to get greyed. In fact, all current pools */ + /* only ever Whiten a whole seg, so we never need to Greyen any */ + /* part of an already Whitened seg. So we hereby exclude white */ + /* segs. */ + /* @@@@ This should not really be called 'trivial'! */ if(!TraceSetIsMember(SegWhite(seg), trace)) SegSetGrey(seg, TraceSetSingle(trace)); } diff --git a/mps/code/trace.c b/mps/code/trace.c index d96bcc0df36..432227170ba 100644 --- a/mps/code/trace.c +++ b/mps/code/trace.c @@ -1807,6 +1807,9 @@ void TraceStart(Trace trace, double mortality, double finishingTime) /* of references in the segment intersects with the */ /* approximation to the white set. */ if (ZoneSetInter(SegSummary(seg), trace->white) != ZoneSetEMPTY) { + /* Note: can a white seg get greyed as well? At this point */ + /* we still assume it may. (This assumption runs out in */ + /* PoolTrivGrey). */ PoolGrey(SegPool(seg), trace, seg); if (TraceSetIsMember(SegGrey(seg), trace)) { trace->foundation += size;