diff --git a/mps/src/poolams.c b/mps/src/poolams.c index 1d0c4cbe018..e957bf40254 100644 --- a/mps/src/poolams.c +++ b/mps/src/poolams.c @@ -1,6 +1,6 @@ /* impl.c.poolams: AUTOMATIC MARK & SWEEP POOL CLASS * - * $HopeName: MMsrc!poolams.c(trunk.11) $ + * $HopeName: MMsrc!poolams.c(trunk.12) $ * Copyright (C) 1997 The Harlequin Group Limited. All rights reserved. * * .readership: any MPS developer. @@ -17,7 +17,7 @@ #include "mpm.h" #include "mpscams.h" -SRCID(poolams, "$HopeName: MMsrc!poolams.c(trunk.11) $"); +SRCID(poolams, "$HopeName: MMsrc!poolams.c(trunk.12) $"); #define AMSSig ((Sig)0x519A3599) /* SIGnature AMS */ @@ -423,6 +423,24 @@ static Bool AMSGroupAlloc(Index *baseReturn, Index *limitReturn, } +/* AMSBufferInit -- the buffer init method + * + * This just sets rankSet. See design.mps.poolams.buffer-init. + */ + +static Res AMSBufferInit(Pool pool, Buffer buffer, va_list args) +{ + Rank rank = va_arg(args, Rank); + + AVERT(Pool, pool); + AVERT(AMS, PoolPoolAMS(pool)); + AVERT(Rank, rank); + + buffer->rankSet = RankSetSingle(rank); + return ResOK; +} + + /* AMSBufferFill -- the pool class buffer fill method. * * Iterates over the segments looking for space. See @@ -1198,7 +1216,7 @@ static PoolClassStruct PoolClassAMSStruct = { AMSFinish, /* finish */ PoolNoAlloc, /* design.mps.poolams.no-alloc */ PoolNoFree, /* design.mps.poolams.no-free */ - PoolTrivBufferInit, /* design.mps.poolams.triv-buffer-init */ + AMSBufferInit, AMSBufferFill, /* bufferFill */ AMSBufferEmpty, /* bufferEmpty */ PoolTrivBufferFinish, /* design.mps.poolams.triv-buffer-finish */ diff --git a/mps/src/poolawl.c b/mps/src/poolawl.c index b8086c9af23..c71d92d7fb1 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.22) $ + * $HopeName: MMsrc!poolawl.c(trunk.23) $ * Copyright (C) 1997 The Harlequin Group Limited. All rights reserved. * * READERSHIP @@ -16,7 +16,7 @@ #include "mpm.h" #include "mpscawl.h" -SRCID(poolawl, "$HopeName: MMsrc!poolawl.c(trunk.22) $"); +SRCID(poolawl, "$HopeName: MMsrc!poolawl.c(trunk.23) $"); #define AWLSig ((Sig)0x519b7a37) /* SIGPooLAWL */ @@ -244,6 +244,22 @@ static void AWLFinish(Pool pool) } +/* AWLBufferInit -- the buffer init method + * + * This just sets rankSet. + */ + +static Res AWLBufferInit(Pool pool, Buffer buffer, va_list args) +{ + AVERT(Pool, pool); + AVERT(AWL, PoolPoolAWL(pool)); + UNUSED(args); + + buffer->rankSet = RankSetSingle(RankWEAK); + return ResOK; +} + + static Res AWLBufferFill(Seg *segReturn, Addr *baseReturn, Addr *limitReturn, Pool pool, Buffer buffer, Size size) { @@ -716,6 +732,7 @@ static Res AWLTraceBegin(Pool pool, Trace trace) return ResOK; } + /* @@@@ completely made-up benefit calculation: each AWL pool gradually * becomes a better candidate for collection as allocation goes * by. Starting a trace on a pool makes it a bad candidate. nickb @@ -745,7 +762,7 @@ struct PoolClassStruct PoolClassAWLStruct = { AWLFinish, PoolNoAlloc, PoolNoFree, - PoolTrivBufferInit, + AWLBufferInit, AWLBufferFill, AWLBufferEmpty, PoolTrivBufferFinish,