1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-19 12:20:17 -08:00

The awl and lo pools were allocating their segments along with other pool’s generation 1, while accounting sizes into generation 0. in fact, this “generation 1” was really a kind of placement “clump” and the segments really lived in generation 0. however, this confused the new chainalloc because there are no longer any “clumps” maintained by the arena, causing awlut to fail. fixed awl and lo to be truthful about the generation they’re allocating in. placement concerns have been removed.

Copied from Perforce
 Change: 184220
 ServerID: perforce.ravenbrook.com
This commit is contained in:
Richard Brooksby 2014-01-29 17:15:31 +00:00
parent eba2dc5a54
commit e02a69f88b
3 changed files with 6 additions and 15 deletions

View file

@ -342,6 +342,7 @@ Res ChainCondemnAuto(double *mortalityReturn, Chain chain, Trace trace)
genNewSize = GenDescNewSize(gen);
} while (genNewSize >= gen->capacity * (Size)1024);
AVER(condemnedSet != ZoneSetEMPTY || condemnedSize == 0);
EVENT3(ChainCondemnAuto, chain, topCondemnedGenSerial, chain->genCount);
UNUSED(topCondemnedGenSerial); /* only used for EVENT */

View file

@ -48,9 +48,6 @@ SRCID(poolawl, "$Id$");
#define AWLSig ((Sig)0x519B7A37) /* SIGnature PooL AWL */
#define AWLGen ((Serial)1) /* "generation" for AWL pools */
/* This and the dynamic criterion are the only ways AWL will get collected. */
/* awlStat* -- Statistics gathering about instruction emulation
*
@ -90,7 +87,6 @@ typedef struct AWLStruct {
Chain chain; /* dummy chain */
PoolGenStruct pgen; /* generation representing the pool */
Size size; /* allocated size in bytes */
Serial gen; /* associated generation (for SegAlloc) */
Count succAccesses; /* number of successive single accesses */
FindDependentMethod findDependent; /* to find a dependent object */
awlStatTotalStruct stats;
@ -470,9 +466,10 @@ static Res AWLSegCreate(AWLSeg *awlsegReturn,
if (size == 0)
return ResMEMORY;
MPS_ARGS_BEGIN(args) {
Serial gen = 0; /* AWL only has one generation in its chain */
MPS_ARGS_ADD_FIELD(args, awlKeySegRankSet, u, rankSet);
MPS_ARGS_DONE(args);
res = ChainAlloc(&seg, awl->chain, awl->gen, AWLSegClassGet(),
res = ChainAlloc(&seg, awl->chain, gen, AWLSegClassGet(),
size, pool, reservoirPermit, args);
} MPS_ARGS_END(args);
if (res != ResOK)
@ -569,7 +566,6 @@ static Res AWLInit(Pool pool, ArgList args)
goto failGenInit;
awl->alignShift = SizeLog2(pool->alignment);
awl->gen = AWLGen;
awl->size = (Size)0;
awl->succAccesses = 0;
@ -1300,9 +1296,6 @@ static Bool AWLCheck(AWL awl)
CHECKL(awl->poolStruct.class == AWLPoolClassGet());
CHECKL((Align)1 << awl->alignShift == awl->poolStruct.alignment);
CHECKD(Chain, awl->chain);
CHECKL(NONNEGATIVE(awl->gen));
/* 30 is just a sanity check really, not a constraint. */
CHECKL(awl->gen <= 30);
/* Nothing to check about succAccesses. */
CHECKL(FUNCHECK(awl->findDependent));
/* Don't bother to check stats. */

View file

@ -15,9 +15,6 @@
SRCID(poollo, "$Id$");
#define LOGen ((Serial)1)
/* LOStruct -- leaf object pool instance structure */
#define LOSig ((Sig)0x51970B07) /* SIGnature LO POoL */
@ -27,7 +24,6 @@ typedef struct LOStruct *LO;
typedef struct LOStruct {
PoolStruct poolStruct; /* generic pool structure */
Shift alignShift; /* log_2 of pool alignment */
Serial gen; /* generation for placement */
Chain chain; /* chain used by this pool */
PoolGenStruct pgen; /* generation representing the pool */
Sig sig;
@ -286,6 +282,7 @@ static Res loSegCreate(LOSeg *loSegReturn, Pool pool, Size size,
LO lo;
Seg seg;
Res res;
Serial gen;
AVER(loSegReturn != NULL);
AVERT(Pool, pool);
@ -294,7 +291,8 @@ static Res loSegCreate(LOSeg *loSegReturn, Pool pool, Size size,
lo = PoolPoolLO(pool);
AVERT(LO, lo);
res = ChainAlloc(&seg, lo->chain, lo->gen, EnsureLOSegClass(),
gen = 0; /* LO only has one generation in its chain */
res = ChainAlloc(&seg, lo->chain, gen, EnsureLOSegClass(),
SizeAlignUp(size, ArenaAlign(PoolArena(pool))),
pool, withReservoirPermit, argsNone);
if (res != ResOK)
@ -494,7 +492,6 @@ static Res LOInit(Pool pool, ArgList args)
lo->poolStruct.alignment = format->alignment;
lo->alignShift =
SizeLog2((Size)PoolAlignment(&lo->poolStruct));
lo->gen = LOGen; /* may be modified in debugger */
res = ChainCreate(&lo->chain, arena, 1, &loGenParam);
if (res != ResOK)
return res;