static void MVFFFinish(Pool pool) { MVFF mvff; Arena arena; Seg seg; Ring ring, node, nextNode; AVERT(Pool, pool); mvff = Pool2MVFF(pool); AVERT(MVFF, mvff); ring = PoolSegRing(pool); RING_FOR(node, ring, nextNode) { seg = SegOfPoolRing(node); AVER(SegPool(seg) == pool); SegFree(seg); }
/* MVTFinish -- finish an MVT pool */ static void MVTFinish(Inst inst) { Pool pool = MustBeA(AbstractPool, inst); MVT mvt = MustBeA(MVTPool, pool); Arena arena = PoolArena(pool); Ring ring; Ring node, nextNode; AVERT(MVT, mvt); mvt->sig = SigInvalid; /* Free the segments in the pool */ ring = PoolSegRing(pool); RING_FOR(node, ring, nextNode) { /* We mustn't call MVTSegFree, because we don't know whether or not * there was any fragmented (unavailable) space in this segment, * and so we can't keep the accounting correct. */ SegFree(SegOfPoolRing(node)); }
static void MVFFFinish(Pool pool) { MVFF mvff; Arena arena; Seg seg; Ring ring, node, nextNode; AVERT(Pool, pool); mvff = Pool2MVFF(pool); AVERT(MVFF, mvff); /* Do this first, because the free list can use the segs in an emergency. */ CBSFinish(CBSOfMVFF(mvff)); ring = PoolSegRing(pool); RING_FOR(node, ring, nextNode) { seg = SegOfPoolRing(node); AVER(SegPool(seg) == pool); SegFree(seg); }