From 7f7caa9e1622eb0bd0da918a9b7505bf646022f2 Mon Sep 17 00:00:00 2001 From: Pekka Pirinen Date: Mon, 24 Jul 2000 20:31:08 +0100 Subject: [PATCH] Change amcgen*frequency scale Copied from Perforce Change: 21373 ServerID: perforce.ravenbrook.com --- mps/src/poolawl.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/mps/src/poolawl.c b/mps/src/poolawl.c index a355896d65d..f26895a7a8d 100644 --- a/mps/src/poolawl.c +++ b/mps/src/poolawl.c @@ -1,6 +1,6 @@ /* impl.c.poolawl: AUTOMATIC WEAK LINKED POOL CLASS * - * $HopeName: MMsrc!poolawl.c(trunk.62) $ + * $HopeName: MMsrc!poolawl.c(trunk.63) $ * Copyright (C) 1999 Harlequin Limited. All rights reserved. * * DESIGN @@ -41,7 +41,7 @@ #include "mpm.h" -SRCID(poolawl, "$HopeName: MMsrc!poolawl.c(trunk.62) $"); +SRCID(poolawl, "$HopeName: MMsrc!poolawl.c(trunk.63) $"); #define AWLSig ((Sig)0x519b7a37) /* SIGPooLAWL */ @@ -84,13 +84,16 @@ typedef struct AWLStruct { AWLStatTotalStruct stats; } AWLStruct, *AWL; + static Bool AWLCheck(AWL awl); + /* PoolPoolAWL -- convert generic Pool to AWL */ #define PoolPoolAWL(pool) \ PARENT(AWLStruct, poolStruct, (pool)) + /* ActionAWL -- converts action to the enclosing AWL */ #define ActionAWL(action) PARENT(AWLStruct, actionStruct, action) @@ -1122,11 +1125,13 @@ static Res AWLAccess(Pool pool, Seg seg, Addr addr, } +/* AWLBenefit -- calculate the benefit of starting an AWL-only collection */ + static double AWLBenefit(Pool pool, Action action) { AWL awl; Arena arena; - double f; /* frequency of collection, in Mb of alloc */ + double f; /* frequency of collection, in kB of alloc */ AVERT(Pool, pool); awl = PoolPoolAWL(pool); @@ -1154,7 +1159,7 @@ static double AWLBenefit(Pool pool, Action action) arena = PoolArena(pool); - return (ArenaMutatorAllocSize(arena) - awl->lastCollected) - f * 1024*1024L; + return (ArenaMutatorAllocSize(arena) - awl->lastCollected) - f * 1024uL; }