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;