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/trace.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'mps/code/trace.c') diff --git a/mps/code/trace.c b/mps/code/trace.c index 1082eaefe78..ff13b6180a9 100644 --- a/mps/code/trace.c +++ b/mps/code/trace.c @@ -770,6 +770,7 @@ static void traceReclaim(Trace trace) { Arena arena; Seg seg; + Ring node, nextNode; AVER(trace->state == TraceRECLAIM); @@ -805,6 +806,13 @@ static void traceReclaim(Trace trace) } trace->state = TraceFINISHED; + + /* Call each pool's TraceEnd method -- do end-of-trace work */ + RING_FOR(node, &ArenaGlobals(arena)->poolRing, nextNode) { + Pool pool = RING_ELT(Pool, arenaRing, node); + PoolTraceEnd(pool, trace); + } + TracePostMessage(trace); /* trace end */ /* Immediately pre-allocate messages for next time; failure is okay */ (void)TraceIdMessagesCreate(arena, trace->ti); -- cgit v1.2.1