From bf80a3a11def6ba68d8f248b389ba84e4e32ced3 Mon Sep 17 00:00:00 2001 From: Richard Kistruck Date: Thu, 20 Aug 2009 17:44:16 +0100 Subject: Mps br/padding: new pooltraceendmethod: do end-of-trace work Tracer calls PoolTraceEnd() when the trace is TraceFINISHED. AbstractPoolClass uses PoolTrivTraceEnd -- a NOOP. [mpm.h, mpmst.h, mpmtypes.h, pool.c, poolabs.c] AMC overrides with AMCTraceEnd, to emit diagnostic on how well the trace went! [poolamc.c] Copied from Perforce Change: 168478 ServerID: perforce.ravenbrook.com --- mps/code/pool.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'mps/code/pool.c') diff --git a/mps/code/pool.c b/mps/code/pool.c index 05045b3f309..e92106128c3 100644 --- a/mps/code/pool.c +++ b/mps/code/pool.c @@ -461,6 +461,23 @@ void PoolReclaim(Pool pool, Trace trace, Seg seg) } +/* PoolTraceEnd -- do end-of-trace work + * + * This method is for a pool class to do final end-of-trace work, + * after all reclaiming is complete. For example, emitting + * diagnostics about what happened during the trace. + */ + +void PoolTraceEnd(Pool pool, Trace trace) +{ + AVERT(Pool, pool); + AVERT(Trace, trace); + AVER(pool->arena == trace->arena); + + (*pool->class->traceEnd)(pool, trace); +} + + /* PoolWalk -- walk objects in this segment */ void PoolWalk(Pool pool, Seg seg, FormattedObjectsStepMethod f, -- cgit v1.2.1