mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-09 05:01:02 -08:00
Assert if you try to create a pool using a format from another arena, a pool using a chain from another arena, or a root using a thread from another arena.
Copied from Perforce Change: 187268 ServerID: perforce.ravenbrook.com
This commit is contained in:
parent
0c42e3aa23
commit
d4b8907389
7 changed files with 18 additions and 4 deletions
|
|
@ -844,7 +844,9 @@ static Res amcInitComm(Pool pool, RankSet rankSet, ArgList args)
|
|||
largeSize = arg.val.size;
|
||||
|
||||
AVERT(Format, pool->format);
|
||||
AVER(FormatArena(pool->format) == arena);
|
||||
AVERT(Chain, chain);
|
||||
AVER(chain->arena == arena);
|
||||
AVER(extendBy > 0);
|
||||
AVER(largeSize > 0);
|
||||
/* TODO: it would be nice to be able to manage large objects that
|
||||
|
|
|
|||
|
|
@ -831,13 +831,15 @@ Res AMSInitInternal(AMS ams, Format format, Chain chain, unsigned gen,
|
|||
Res res;
|
||||
|
||||
/* Can't check ams, it's not initialized. */
|
||||
AVERT(Format, format);
|
||||
AVERT(Chain, chain);
|
||||
AVER(gen <= ChainGens(chain));
|
||||
|
||||
pool = AMSPool(ams);
|
||||
AVERT(Pool, pool);
|
||||
AVERT(Format, format);
|
||||
AVER(FormatArena(format) == PoolArena(pool));
|
||||
pool->format = format;
|
||||
AVERT(Chain, chain);
|
||||
AVER(gen <= ChainGens(chain));
|
||||
AVER(chain->arena == PoolArena(pool));
|
||||
|
||||
pool->alignment = pool->format->alignment;
|
||||
ams->grainShift = SizeLog2(PoolAlignment(pool));
|
||||
|
||||
|
|
|
|||
|
|
@ -575,6 +575,7 @@ static Res AWLInit(Pool pool, ArgList args)
|
|||
gen = arg.val.u;
|
||||
|
||||
AVERT(Format, format);
|
||||
AVER(FormatArena(format) == PoolArena(pool));
|
||||
pool->format = format;
|
||||
pool->alignment = format->alignment;
|
||||
|
||||
|
|
@ -583,6 +584,7 @@ static Res AWLInit(Pool pool, ArgList args)
|
|||
|
||||
AVERT(Chain, chain);
|
||||
AVER(gen <= ChainGens(chain));
|
||||
AVER(chain->arena == PoolArena(pool));
|
||||
|
||||
res = PoolGenInit(&awl->pgen, ChainGen(chain, gen), pool);
|
||||
if (res != ResOK)
|
||||
|
|
|
|||
|
|
@ -504,8 +504,10 @@ static Res LOInit(Pool pool, ArgList args)
|
|||
gen = arg.val.u;
|
||||
|
||||
AVERT(Format, pool->format);
|
||||
AVER(FormatArena(pool->format) == arena);
|
||||
AVERT(Chain, chain);
|
||||
AVER(gen <= ChainGens(chain));
|
||||
AVER(chain->arena == arena);
|
||||
|
||||
pool->alignment = pool->format->alignment;
|
||||
lo->alignShift = SizeLog2((Size)PoolAlignment(pool));
|
||||
|
|
|
|||
|
|
@ -387,6 +387,7 @@ static Res SNCInit(Pool pool, ArgList args)
|
|||
format = arg.val.format;
|
||||
|
||||
AVERT(Format, format);
|
||||
AVER(FormatArena(format) == PoolArena(pool));
|
||||
pool->format = format;
|
||||
snc->freeSegs = NULL;
|
||||
snc->sig = SNCSig;
|
||||
|
|
|
|||
|
|
@ -304,6 +304,7 @@ Res RootCreateReg(Root *rootReturn, Arena arena,
|
|||
AVERT(Arena, arena);
|
||||
AVERT(Rank, rank);
|
||||
AVERT(Thread, thread);
|
||||
AVER(ThreadArena(thread) == arena);
|
||||
AVER(scan != NULL);
|
||||
|
||||
theUnion.reg.scan = scan;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue