mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-17 16:41:17 -08:00
[bug]
BufferInit now needs to set the rank Copied from Perforce Change: 18943 ServerID: perforce.ravenbrook.com GitHub-reference: https://github.com/Ravenbrook/mps/issues/21010
This commit is contained in:
parent
1b6271d0d7
commit
04cc601046
2 changed files with 41 additions and 6 deletions
|
|
@ -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 */
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue