From ccbf5341e8935b04ebbe3d1bb4fc5a7dbfcf8a82 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Fri, 7 Jun 2013 15:39:07 +0100 Subject: [PATCH] Mvtfinish must make the structure invalid first. Add comment explaining choice of GCSegClass. Copied from Perforce Change: 182608 ServerID: perforce.ravenbrook.com --- mps/code/poolmv2.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mps/code/poolmv2.c b/mps/code/poolmv2.c index eb5d75a128f..c4c14188ebd 100644 --- a/mps/code/poolmv2.c +++ b/mps/code/poolmv2.c @@ -420,6 +420,8 @@ static void MVTFinish(Pool pool) arena = PoolArena(pool); AVERT(Arena, arena); + mvt->sig = SigInvalid; + /* Free the segments in the pool */ ring = PoolSegRing(pool); RING_FOR(node, ring, nextNode) { @@ -430,8 +432,6 @@ static void MVTFinish(Pool pool) FreelistFinish(MVTFreelist(mvt)); ABQFinish(arena, MVTABQ(mvt)); CBSFinish(MVTCBS(mvt)); - - mvt->sig = SigInvalid; } @@ -1056,6 +1056,8 @@ size_t mps_mvt_free_size(mps_pool_t mps_pool) static Res MVTSegAlloc(Seg *segReturn, MVT mvt, Size size, Pool pool, Bool withReservoirPermit) { + /* Can't use plain old SegClass here because we need to call + * SegBuffer() in MVTFree(). */ Res res = SegAlloc(segReturn, GCSegClassGet(), MVTSegPref(mvt), size, pool, withReservoirPermit, argsNone);