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:
parent
eba2dc5a54
commit
e02a69f88b
3 changed files with 6 additions and 15 deletions
|
|
@ -342,6 +342,7 @@ Res ChainCondemnAuto(double *mortalityReturn, Chain chain, Trace trace)
|
||||||
genNewSize = GenDescNewSize(gen);
|
genNewSize = GenDescNewSize(gen);
|
||||||
} while (genNewSize >= gen->capacity * (Size)1024);
|
} while (genNewSize >= gen->capacity * (Size)1024);
|
||||||
|
|
||||||
|
AVER(condemnedSet != ZoneSetEMPTY || condemnedSize == 0);
|
||||||
EVENT3(ChainCondemnAuto, chain, topCondemnedGenSerial, chain->genCount);
|
EVENT3(ChainCondemnAuto, chain, topCondemnedGenSerial, chain->genCount);
|
||||||
UNUSED(topCondemnedGenSerial); /* only used for EVENT */
|
UNUSED(topCondemnedGenSerial); /* only used for EVENT */
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -48,9 +48,6 @@ SRCID(poolawl, "$Id$");
|
||||||
|
|
||||||
#define AWLSig ((Sig)0x519B7A37) /* SIGnature PooL AWL */
|
#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
|
/* awlStat* -- Statistics gathering about instruction emulation
|
||||||
*
|
*
|
||||||
|
|
@ -90,7 +87,6 @@ typedef struct AWLStruct {
|
||||||
Chain chain; /* dummy chain */
|
Chain chain; /* dummy chain */
|
||||||
PoolGenStruct pgen; /* generation representing the pool */
|
PoolGenStruct pgen; /* generation representing the pool */
|
||||||
Size size; /* allocated size in bytes */
|
Size size; /* allocated size in bytes */
|
||||||
Serial gen; /* associated generation (for SegAlloc) */
|
|
||||||
Count succAccesses; /* number of successive single accesses */
|
Count succAccesses; /* number of successive single accesses */
|
||||||
FindDependentMethod findDependent; /* to find a dependent object */
|
FindDependentMethod findDependent; /* to find a dependent object */
|
||||||
awlStatTotalStruct stats;
|
awlStatTotalStruct stats;
|
||||||
|
|
@ -470,9 +466,10 @@ static Res AWLSegCreate(AWLSeg *awlsegReturn,
|
||||||
if (size == 0)
|
if (size == 0)
|
||||||
return ResMEMORY;
|
return ResMEMORY;
|
||||||
MPS_ARGS_BEGIN(args) {
|
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_ADD_FIELD(args, awlKeySegRankSet, u, rankSet);
|
||||||
MPS_ARGS_DONE(args);
|
MPS_ARGS_DONE(args);
|
||||||
res = ChainAlloc(&seg, awl->chain, awl->gen, AWLSegClassGet(),
|
res = ChainAlloc(&seg, awl->chain, gen, AWLSegClassGet(),
|
||||||
size, pool, reservoirPermit, args);
|
size, pool, reservoirPermit, args);
|
||||||
} MPS_ARGS_END(args);
|
} MPS_ARGS_END(args);
|
||||||
if (res != ResOK)
|
if (res != ResOK)
|
||||||
|
|
@ -569,7 +566,6 @@ static Res AWLInit(Pool pool, ArgList args)
|
||||||
goto failGenInit;
|
goto failGenInit;
|
||||||
|
|
||||||
awl->alignShift = SizeLog2(pool->alignment);
|
awl->alignShift = SizeLog2(pool->alignment);
|
||||||
awl->gen = AWLGen;
|
|
||||||
awl->size = (Size)0;
|
awl->size = (Size)0;
|
||||||
|
|
||||||
awl->succAccesses = 0;
|
awl->succAccesses = 0;
|
||||||
|
|
@ -1300,9 +1296,6 @@ static Bool AWLCheck(AWL awl)
|
||||||
CHECKL(awl->poolStruct.class == AWLPoolClassGet());
|
CHECKL(awl->poolStruct.class == AWLPoolClassGet());
|
||||||
CHECKL((Align)1 << awl->alignShift == awl->poolStruct.alignment);
|
CHECKL((Align)1 << awl->alignShift == awl->poolStruct.alignment);
|
||||||
CHECKD(Chain, awl->chain);
|
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. */
|
/* Nothing to check about succAccesses. */
|
||||||
CHECKL(FUNCHECK(awl->findDependent));
|
CHECKL(FUNCHECK(awl->findDependent));
|
||||||
/* Don't bother to check stats. */
|
/* Don't bother to check stats. */
|
||||||
|
|
|
||||||
|
|
@ -15,9 +15,6 @@
|
||||||
SRCID(poollo, "$Id$");
|
SRCID(poollo, "$Id$");
|
||||||
|
|
||||||
|
|
||||||
#define LOGen ((Serial)1)
|
|
||||||
|
|
||||||
|
|
||||||
/* LOStruct -- leaf object pool instance structure */
|
/* LOStruct -- leaf object pool instance structure */
|
||||||
|
|
||||||
#define LOSig ((Sig)0x51970B07) /* SIGnature LO POoL */
|
#define LOSig ((Sig)0x51970B07) /* SIGnature LO POoL */
|
||||||
|
|
@ -27,7 +24,6 @@ typedef struct LOStruct *LO;
|
||||||
typedef struct LOStruct {
|
typedef struct LOStruct {
|
||||||
PoolStruct poolStruct; /* generic pool structure */
|
PoolStruct poolStruct; /* generic pool structure */
|
||||||
Shift alignShift; /* log_2 of pool alignment */
|
Shift alignShift; /* log_2 of pool alignment */
|
||||||
Serial gen; /* generation for placement */
|
|
||||||
Chain chain; /* chain used by this pool */
|
Chain chain; /* chain used by this pool */
|
||||||
PoolGenStruct pgen; /* generation representing the pool */
|
PoolGenStruct pgen; /* generation representing the pool */
|
||||||
Sig sig;
|
Sig sig;
|
||||||
|
|
@ -286,6 +282,7 @@ static Res loSegCreate(LOSeg *loSegReturn, Pool pool, Size size,
|
||||||
LO lo;
|
LO lo;
|
||||||
Seg seg;
|
Seg seg;
|
||||||
Res res;
|
Res res;
|
||||||
|
Serial gen;
|
||||||
|
|
||||||
AVER(loSegReturn != NULL);
|
AVER(loSegReturn != NULL);
|
||||||
AVERT(Pool, pool);
|
AVERT(Pool, pool);
|
||||||
|
|
@ -294,7 +291,8 @@ static Res loSegCreate(LOSeg *loSegReturn, Pool pool, Size size,
|
||||||
lo = PoolPoolLO(pool);
|
lo = PoolPoolLO(pool);
|
||||||
AVERT(LO, lo);
|
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))),
|
SizeAlignUp(size, ArenaAlign(PoolArena(pool))),
|
||||||
pool, withReservoirPermit, argsNone);
|
pool, withReservoirPermit, argsNone);
|
||||||
if (res != ResOK)
|
if (res != ResOK)
|
||||||
|
|
@ -494,7 +492,6 @@ static Res LOInit(Pool pool, ArgList args)
|
||||||
lo->poolStruct.alignment = format->alignment;
|
lo->poolStruct.alignment = format->alignment;
|
||||||
lo->alignShift =
|
lo->alignShift =
|
||||||
SizeLog2((Size)PoolAlignment(&lo->poolStruct));
|
SizeLog2((Size)PoolAlignment(&lo->poolStruct));
|
||||||
lo->gen = LOGen; /* may be modified in debugger */
|
|
||||||
res = ChainCreate(&lo->chain, arena, 1, &loGenParam);
|
res = ChainCreate(&lo->chain, arena, 1, &loGenParam);
|
||||||
if (res != ResOK)
|
if (res != ResOK)
|
||||||
return res;
|
return res;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue