1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-04-29 09:43:56 -07:00

New pool method poolsegpoolgen gets the pool generation for a segment. (this allows the segment whiten and reclaim methods not to need to know the pool class.)

Copied from Perforce
 Change: 193084
 ServerID: perforce.ravenbrook.com
This commit is contained in:
Gareth Rees 2017-03-31 13:28:25 +01:00
parent d8a5c865ba
commit 2b3fbbb8d3
12 changed files with 170 additions and 123 deletions

View file

@ -45,6 +45,7 @@ Bool PoolClassCheck(PoolClass klass)
CHECKL(FUNCHECK(klass->init));
CHECKL(FUNCHECK(klass->alloc));
CHECKL(FUNCHECK(klass->free));
CHECKL(FUNCHECK(klass->segPoolGen));
CHECKL(FUNCHECK(klass->bufferFill));
CHECKL(FUNCHECK(klass->bufferEmpty));
CHECKL(FUNCHECK(klass->rampBegin));
@ -259,6 +260,17 @@ void PoolFree(Pool pool, Addr old, Size size)
}
/* PoolSegPoolGen -- get pool generation for a segment */
PoolGen PoolSegPoolGen(Pool pool, Seg seg)
{
AVERT(Pool, pool);
AVERT(Seg, seg);
AVER(pool == SegPool(seg));
return Method(Pool, pool, segPoolGen)(pool, seg);
}
/* PoolFreeWalk -- walk free blocks in this pool
*
* PoolFreeWalk is not required to find all free blocks.