mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-04-27 08:43:40 -07:00
Referring to classes by their base identifiers.
Copied from Perforce Change: 190823 ServerID: perforce.ravenbrook.com
This commit is contained in:
parent
d3d57e828d
commit
e5efe2849f
33 changed files with 267 additions and 265 deletions
|
|
@ -77,9 +77,9 @@ static Res ArenaTrivDescribe(Arena arena, mps_lib_FILE *stream, Count depth)
|
|||
|
||||
typedef ArenaClassStruct AbstractArenaClassStruct;
|
||||
|
||||
DEFINE_CLASS(AbstractArenaClass, class)
|
||||
DEFINE_CLASS(AbstractArena, class)
|
||||
{
|
||||
INHERIT_CLASS(&class->protocol, AbstractArenaClass, InstClass);
|
||||
INHERIT_CLASS(&class->protocol, AbstractArena, Inst);
|
||||
class->size = 0;
|
||||
class->varargs = ArgTrivVarargs;
|
||||
class->init = NULL;
|
||||
|
|
@ -297,7 +297,7 @@ static Res arenaFreeLandInit(Arena arena)
|
|||
/* Initialise the free land. */
|
||||
MPS_ARGS_BEGIN(liArgs) {
|
||||
MPS_ARGS_ADD(liArgs, CBSBlockPool, ArenaCBSBlockPool(arena));
|
||||
res = LandInit(ArenaFreeLand(arena), CLASS(CBSZonedLandClass), arena,
|
||||
res = LandInit(ArenaFreeLand(arena), CLASS(CBSZonedLand), arena,
|
||||
ArenaGrainSize(arena), arena, liArgs);
|
||||
} MPS_ARGS_END(liArgs);
|
||||
AVER(res == ResOK); /* no allocation, no failure expected */
|
||||
|
|
|
|||
|
|
@ -447,9 +447,9 @@ static void ClientArenaFree(Addr base, Size size, Pool pool)
|
|||
|
||||
/* ClientArenaClass -- The Client arena class definition */
|
||||
|
||||
DEFINE_ARENA_CLASS(ClientArenaClass, this)
|
||||
DEFINE_ARENA_CLASS(ClientArena, this)
|
||||
{
|
||||
INHERIT_CLASS(this, ClientArenaClass, AbstractArenaClass);
|
||||
INHERIT_CLASS(this, ClientArena, AbstractArena);
|
||||
this->size = sizeof(ClientArenaStruct);
|
||||
this->varargs = ClientArenaVarargs;
|
||||
this->init = ClientArenaInit;
|
||||
|
|
@ -467,7 +467,7 @@ DEFINE_ARENA_CLASS(ClientArenaClass, this)
|
|||
|
||||
mps_arena_class_t mps_arena_class_cl(void)
|
||||
{
|
||||
return (mps_arena_class_t)CLASS(ClientArenaClass);
|
||||
return (mps_arena_class_t)CLASS(ClientArena);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -249,7 +249,7 @@ static Res allocAsSeg(AllocInfoStruct *aiReturn, LocusPref pref,
|
|||
{
|
||||
Res res;
|
||||
Seg seg;
|
||||
res = SegAlloc(&seg, CLASS(SegClass), pref, size, pool, argsNone);
|
||||
res = SegAlloc(&seg, CLASS(Seg), pref, size, pool, argsNone);
|
||||
if (res == ResOK) {
|
||||
aiReturn->the.segData.seg = seg;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ typedef struct VMArenaStruct { /* VM arena structure */
|
|||
|
||||
static Size VMPurgeSpare(Arena arena, Size size);
|
||||
static void chunkUnmapSpare(Chunk chunk);
|
||||
DECLARE_CLASS(ArenaClass, VMArenaClass);
|
||||
DECLARE_CLASS(Arena, VMArena);
|
||||
static void VMCompact(Arena arena, Trace trace);
|
||||
|
||||
|
||||
|
|
@ -206,7 +206,7 @@ static Res VMArenaDescribe(Arena arena, mps_lib_FILE *stream, Count depth)
|
|||
/* ...but the next method is ArenaTrivDescribe, so don't call it;
|
||||
* see impl.c.arena#describe.triv.dont-upcall.
|
||||
*
|
||||
super = ARENA_SUPERCLASS(VMArenaClass);
|
||||
super = ARENA_SUPERCLASS(VMArena);
|
||||
res = super->describe(arena, stream);
|
||||
if (res != ResOK)
|
||||
return res;
|
||||
|
|
@ -519,7 +519,7 @@ static Res VMArenaInit(Arena *arenaReturn, ArenaClass class, ArgList args)
|
|||
char vmParams[VMParamSize];
|
||||
|
||||
AVER(arenaReturn != NULL);
|
||||
AVER(class == CLASS(VMArenaClass));
|
||||
AVER(class == CLASS(VMArena));
|
||||
AVERT(ArgList, args);
|
||||
|
||||
if (ArgPick(&arg, args, MPS_KEY_ARENA_GRAIN_SIZE))
|
||||
|
|
@ -1181,9 +1181,9 @@ mps_res_t mps_arena_vm_growth(mps_arena_t mps_arena,
|
|||
|
||||
/* VMArenaClass -- The VM arena class definition */
|
||||
|
||||
DEFINE_ARENA_CLASS(VMArenaClass, this)
|
||||
DEFINE_ARENA_CLASS(VMArena, this)
|
||||
{
|
||||
INHERIT_CLASS(this, VMArenaClass, AbstractArenaClass);
|
||||
INHERIT_CLASS(this, VMArena, AbstractArena);
|
||||
this->size = sizeof(VMArenaStruct);
|
||||
this->varargs = VMArenaVarargs;
|
||||
this->init = VMArenaInit;
|
||||
|
|
@ -1204,7 +1204,7 @@ DEFINE_ARENA_CLASS(VMArenaClass, this)
|
|||
|
||||
mps_arena_class_t mps_arena_class_vm(void)
|
||||
{
|
||||
return (mps_arena_class_t)CLASS(VMArenaClass);
|
||||
return (mps_arena_class_t)CLASS(VMArena);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1192,9 +1192,9 @@ Bool BufferClassCheck(BufferClass class)
|
|||
*
|
||||
* See <design/buffer/#class.hierarchy.buffer>. */
|
||||
|
||||
DEFINE_CLASS(BufferClass, class)
|
||||
DEFINE_CLASS(Buffer, class)
|
||||
{
|
||||
INHERIT_CLASS(&class->protocol, BufferClass, InstClass);
|
||||
INHERIT_CLASS(&class->protocol, Buffer, Inst);
|
||||
class->size = sizeof(BufferStruct);
|
||||
class->varargs = ArgTrivVarargs;
|
||||
class->init = bufferTrivInit;
|
||||
|
|
@ -1265,7 +1265,7 @@ static Res segBufInit(Buffer buffer, Pool pool, ArgList args)
|
|||
segbuf = BufferSegBuf(buffer);
|
||||
|
||||
/* Initialize the superclass fields first via next-method call */
|
||||
super = BUFFER_SUPERCLASS(SegBufClass);
|
||||
super = BUFFER_SUPERCLASS(SegBuf);
|
||||
res = super->init(buffer, pool, args);
|
||||
if (res != ResOK)
|
||||
return res;
|
||||
|
|
@ -1295,7 +1295,7 @@ static void segBufFinish (Buffer buffer)
|
|||
segbuf->sig = SigInvalid;
|
||||
|
||||
/* finish the superclass fields last */
|
||||
super = BUFFER_SUPERCLASS(SegBufClass);
|
||||
super = BUFFER_SUPERCLASS(SegBuf);
|
||||
super->finish(buffer);
|
||||
}
|
||||
|
||||
|
|
@ -1429,7 +1429,7 @@ static Res segBufDescribe(Buffer buffer, mps_lib_FILE *stream, Count depth)
|
|||
return ResFAIL;
|
||||
|
||||
/* Describe the superclass fields first via next-method call */
|
||||
super = BUFFER_SUPERCLASS(SegBufClass);
|
||||
super = BUFFER_SUPERCLASS(SegBuf);
|
||||
res = super->describe(buffer, stream, depth);
|
||||
if (res != ResOK)
|
||||
return res;
|
||||
|
|
@ -1450,9 +1450,9 @@ static Res segBufDescribe(Buffer buffer, mps_lib_FILE *stream, Count depth)
|
|||
|
||||
typedef BufferClassStruct SegBufClassStruct;
|
||||
|
||||
DEFINE_CLASS(SegBufClass, class)
|
||||
DEFINE_CLASS(SegBuf, class)
|
||||
{
|
||||
INHERIT_CLASS(class, SegBufClass, BufferClass);
|
||||
INHERIT_CLASS(class, SegBuf, Buffer);
|
||||
class->size = sizeof(SegBufStruct);
|
||||
class->init = segBufInit;
|
||||
class->finish = segBufFinish;
|
||||
|
|
@ -1497,7 +1497,7 @@ static Res rankBufInit(Buffer buffer, Pool pool, ArgList args)
|
|||
AVERT(Rank, rank);
|
||||
|
||||
/* Initialize the superclass fields first via next-method call */
|
||||
super = BUFFER_SUPERCLASS(RankBufClass);
|
||||
super = BUFFER_SUPERCLASS(RankBuf);
|
||||
res = super->init(buffer, pool, args);
|
||||
if (res != ResOK)
|
||||
return res;
|
||||
|
|
@ -1518,9 +1518,9 @@ static Res rankBufInit(Buffer buffer, Pool pool, ArgList args)
|
|||
|
||||
typedef BufferClassStruct RankBufClassStruct;
|
||||
|
||||
DEFINE_CLASS(RankBufClass, class)
|
||||
DEFINE_CLASS(RankBuf, class)
|
||||
{
|
||||
INHERIT_CLASS(class, RankBufClass, SegBufClass);
|
||||
INHERIT_CLASS(class, RankBuf, SegBuf);
|
||||
class->varargs = rankBufVarargs;
|
||||
class->init = rankBufInit;
|
||||
AVERT(BufferClass, class);
|
||||
|
|
|
|||
|
|
@ -226,7 +226,7 @@ static Res cbsInitComm(Land land, ArgList args, SplayUpdateNodeFunction update,
|
|||
Pool blockPool = NULL;
|
||||
|
||||
AVERT(Land, land);
|
||||
super = LAND_SUPERCLASS(CBSLandClass);
|
||||
super = LAND_SUPERCLASS(CBSLand);
|
||||
res = (*super->init)(land, args);
|
||||
if (res != ResOK)
|
||||
return res;
|
||||
|
|
@ -1164,9 +1164,9 @@ static Res cbsDescribe(Land land, mps_lib_FILE *stream, Count depth)
|
|||
return res;
|
||||
}
|
||||
|
||||
DEFINE_LAND_CLASS(CBSLandClass, class)
|
||||
DEFINE_LAND_CLASS(CBSLand, class)
|
||||
{
|
||||
INHERIT_CLASS(class, CBSLandClass, LandClass);
|
||||
INHERIT_CLASS(class, CBSLand, Land);
|
||||
class->size = sizeof(CBSStruct);
|
||||
class->init = cbsInit;
|
||||
class->finish = cbsFinish;
|
||||
|
|
@ -1183,16 +1183,16 @@ DEFINE_LAND_CLASS(CBSLandClass, class)
|
|||
AVERT(LandClass, class);
|
||||
}
|
||||
|
||||
DEFINE_LAND_CLASS(CBSFastLandClass, class)
|
||||
DEFINE_LAND_CLASS(CBSFastLand, class)
|
||||
{
|
||||
INHERIT_CLASS(class, CBSFastLandClass, CBSLandClass);
|
||||
INHERIT_CLASS(class, CBSFastLand, CBSLand);
|
||||
class->init = cbsInitFast;
|
||||
AVERT(LandClass, class);
|
||||
}
|
||||
|
||||
DEFINE_LAND_CLASS(CBSZonedLandClass, class)
|
||||
DEFINE_LAND_CLASS(CBSZonedLand, class)
|
||||
{
|
||||
INHERIT_CLASS(class, CBSZonedLandClass, CBSFastLandClass);
|
||||
INHERIT_CLASS(class, CBSZonedLand, CBSFastLand);
|
||||
class->init = cbsInitZoned;
|
||||
AVERT(LandClass, class);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,9 +39,9 @@ typedef struct CBSStruct *CBS;
|
|||
extern Bool CBSCheck(CBS cbs);
|
||||
#define CBSLand(cbs) (&(cbs)->landStruct)
|
||||
|
||||
DECLARE_CLASS(LandClass, CBSLandClass);
|
||||
DECLARE_CLASS(LandClass, CBSFastLandClass);
|
||||
DECLARE_CLASS(LandClass, CBSZonedLandClass);
|
||||
DECLARE_CLASS(Land, CBSLand);
|
||||
DECLARE_CLASS(Land, CBSFastLand);
|
||||
DECLARE_CLASS(Land, CBSZonedLand);
|
||||
|
||||
extern const struct mps_key_s _mps_key_cbs_block_pool;
|
||||
#define CBSBlockPool (&_mps_key_cbs_block_pool)
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ static Res failoverInit(Land land, ArgList args)
|
|||
Res res;
|
||||
|
||||
AVERT(Land, land);
|
||||
super = LAND_SUPERCLASS(FailoverLandClass);
|
||||
super = LAND_SUPERCLASS(FailoverLand);
|
||||
res = (*super->init)(land, args);
|
||||
if (res != ResOK)
|
||||
return res;
|
||||
|
|
@ -301,9 +301,9 @@ static Res failoverDescribe(Land land, mps_lib_FILE *stream, Count depth)
|
|||
}
|
||||
|
||||
|
||||
DEFINE_LAND_CLASS(FailoverLandClass, class)
|
||||
DEFINE_LAND_CLASS(FailoverLand, class)
|
||||
{
|
||||
INHERIT_CLASS(class, FailoverLandClass, LandClass);
|
||||
INHERIT_CLASS(class, FailoverLand, Land);
|
||||
class->size = sizeof(FailoverStruct);
|
||||
class->init = failoverInit;
|
||||
class->finish = failoverFinish;
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ typedef struct FailoverStruct *Failover;
|
|||
|
||||
extern Bool FailoverCheck(Failover failover);
|
||||
|
||||
DECLARE_CLASS(LandClass, FailoverLandClass);
|
||||
DECLARE_CLASS(Land, FailoverLand);
|
||||
|
||||
extern const struct mps_key_s _mps_key_failover_primary;
|
||||
#define FailoverPrimary (&_mps_key_failover_primary)
|
||||
|
|
|
|||
|
|
@ -60,10 +60,10 @@ static Res oomAlloc(Addr *pReturn, Pool pool, Size size)
|
|||
}
|
||||
}
|
||||
|
||||
DECLARE_CLASS(PoolClass, OOMPoolClass);
|
||||
DEFINE_POOL_CLASS(OOMPoolClass, this)
|
||||
DECLARE_CLASS(Pool, OOMPool);
|
||||
DEFINE_POOL_CLASS(OOMPool, this)
|
||||
{
|
||||
INHERIT_CLASS(this, OOMPoolClass, AbstractPoolClass);
|
||||
INHERIT_CLASS(this, OOMPool, AbstractPool);
|
||||
this->alloc = oomAlloc;
|
||||
this->free = PoolTrivFree;
|
||||
this->size = sizeof(PoolStruct);
|
||||
|
|
@ -92,7 +92,7 @@ static mps_res_t make(mps_addr_t *p, mps_ap_t ap, size_t size)
|
|||
static void set_oom(Land land, int oom)
|
||||
{
|
||||
CBS cbs = PARENT(CBSStruct, landStruct, land);
|
||||
cbs->blockPool->class = oom ? CLASS(OOMPoolClass) : PoolClassMFS();
|
||||
cbs->blockPool->class = oom ? CLASS(OOMPool) : PoolClassMFS();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -194,7 +194,7 @@ static Res freelistInit(Land land, ArgList args)
|
|||
Res res;
|
||||
|
||||
AVERT(Land, land);
|
||||
super = LAND_SUPERCLASS(FreelistLandClass);
|
||||
super = LAND_SUPERCLASS(FreelistLand);
|
||||
res = (*super->init)(land, args);
|
||||
if (res != ResOK)
|
||||
return res;
|
||||
|
|
@ -809,9 +809,9 @@ static Res freelistDescribe(Land land, mps_lib_FILE *stream, Count depth)
|
|||
}
|
||||
|
||||
|
||||
DEFINE_LAND_CLASS(FreelistLandClass, class)
|
||||
DEFINE_LAND_CLASS(FreelistLand, class)
|
||||
{
|
||||
INHERIT_CLASS(class, FreelistLandClass, LandClass);
|
||||
INHERIT_CLASS(class, FreelistLand, Land);
|
||||
class->size = sizeof(FreelistStruct);
|
||||
class->init = freelistInit;
|
||||
class->finish = freelistFinish;
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ extern Bool FreelistCheck(Freelist freelist);
|
|||
/* See <design/freelist/#impl.grain.align> */
|
||||
#define FreelistMinimumAlignment ((Align)sizeof(FreelistBlock))
|
||||
|
||||
DECLARE_CLASS(LandClass, FreelistLandClass);
|
||||
DECLARE_CLASS(Land, FreelistLand);
|
||||
|
||||
#endif /* freelist.h */
|
||||
|
||||
|
|
|
|||
|
|
@ -574,9 +574,9 @@ static Res landTrivDescribe(Land land, mps_lib_FILE *stream, Count depth)
|
|||
return ResOK;
|
||||
}
|
||||
|
||||
DEFINE_CLASS(LandClass, class)
|
||||
DEFINE_CLASS(Land, class)
|
||||
{
|
||||
INHERIT_CLASS(&class->protocol, LandClass, InstClass);
|
||||
INHERIT_CLASS(&class->protocol, Land, Inst);
|
||||
class->size = sizeof(LandStruct);
|
||||
class->init = landTrivInit;
|
||||
class->sizeMethod = landNoSize;
|
||||
|
|
|
|||
|
|
@ -471,7 +471,7 @@ extern int main(int argc, char *argv[])
|
|||
/* 1. Test CBS */
|
||||
|
||||
MPS_ARGS_BEGIN(args) {
|
||||
die((mps_res_t)LandInit(cbs, CLASS(CBSFastLandClass), arena, state.align,
|
||||
die((mps_res_t)LandInit(cbs, CLASS(CBSFastLand), arena, state.align,
|
||||
NULL, args),
|
||||
"failed to initialise CBS");
|
||||
} MPS_ARGS_END(args);
|
||||
|
|
@ -481,7 +481,7 @@ extern int main(int argc, char *argv[])
|
|||
|
||||
/* 2. Test Freelist */
|
||||
|
||||
die((mps_res_t)LandInit(fl, CLASS(FreelistLandClass), arena, state.align,
|
||||
die((mps_res_t)LandInit(fl, CLASS(FreelistLand), arena, state.align,
|
||||
NULL, mps_args_none),
|
||||
"failed to initialise Freelist");
|
||||
state.land = fl;
|
||||
|
|
@ -503,18 +503,18 @@ extern int main(int argc, char *argv[])
|
|||
|
||||
MPS_ARGS_BEGIN(args) {
|
||||
MPS_ARGS_ADD(args, CBSBlockPool, mfs);
|
||||
die((mps_res_t)LandInit(cbs, CLASS(CBSFastLandClass), arena, state.align,
|
||||
die((mps_res_t)LandInit(cbs, CLASS(CBSFastLand), arena, state.align,
|
||||
NULL, args),
|
||||
"failed to initialise CBS");
|
||||
} MPS_ARGS_END(args);
|
||||
|
||||
die((mps_res_t)LandInit(fl, CLASS(FreelistLandClass), arena, state.align,
|
||||
die((mps_res_t)LandInit(fl, CLASS(FreelistLand), arena, state.align,
|
||||
NULL, mps_args_none),
|
||||
"failed to initialise Freelist");
|
||||
MPS_ARGS_BEGIN(args) {
|
||||
MPS_ARGS_ADD(args, FailoverPrimary, cbs);
|
||||
MPS_ARGS_ADD(args, FailoverSecondary, fl);
|
||||
die((mps_res_t)LandInit(fo, CLASS(FailoverLandClass), arena, state.align,
|
||||
die((mps_res_t)LandInit(fo, CLASS(FailoverLand), arena, state.align,
|
||||
NULL, args),
|
||||
"failed to initialise Failover");
|
||||
} MPS_ARGS_END(args);
|
||||
|
|
|
|||
|
|
@ -300,18 +300,18 @@ extern void PoolClassMixInBuffer(PoolClass class);
|
|||
extern void PoolClassMixInScan(PoolClass class);
|
||||
extern void PoolClassMixInFormat(PoolClass class);
|
||||
extern void PoolClassMixInCollect(PoolClass class);
|
||||
DECLARE_CLASS(AbstractPoolClass, AbstractPoolClass);
|
||||
DECLARE_CLASS(AbstractBufferPoolClass, AbstractBufferPoolClass);
|
||||
DECLARE_CLASS(AbstractBufferPoolClass, AbstractSegBufPoolClass);
|
||||
DECLARE_CLASS(AbstractScanPoolClass, AbstractScanPoolClass);
|
||||
DECLARE_CLASS(AbstractCollectPoolClass, AbstractCollectPoolClass);
|
||||
DECLARE_CLASS(AbstractPool, AbstractPool);
|
||||
DECLARE_CLASS(AbstractBufferPool, AbstractBufferPool);
|
||||
DECLARE_CLASS(AbstractBufferPool, AbstractSegBufPool);
|
||||
DECLARE_CLASS(AbstractScanPool, AbstractScanPool);
|
||||
DECLARE_CLASS(AbstractCollectPool, AbstractCollectPool);
|
||||
|
||||
/* DEFINE_POOL_CLASS
|
||||
*
|
||||
* Convenience macro -- see <design/protocol/#int.define-special>. */
|
||||
|
||||
#define DEFINE_POOL_CLASS(className, var) \
|
||||
DEFINE_ALIAS_CLASS(className, PoolClass, var)
|
||||
DEFINE_ALIAS_CLASS(className, Pool, var)
|
||||
|
||||
#define POOL_SUPERCLASS(className) \
|
||||
((PoolClass)SUPERCLASS(className))
|
||||
|
|
@ -493,12 +493,12 @@ extern void TraceScanSingleRef(TraceSet ts, Rank rank, Arena arena,
|
|||
* Convenience macro -- see <design/protocol/#int.define-special>. */
|
||||
|
||||
#define DEFINE_ARENA_CLASS(className, var) \
|
||||
DEFINE_ALIAS_CLASS(className, ArenaClass, var)
|
||||
DEFINE_ALIAS_CLASS(className, Arena, var)
|
||||
|
||||
#define ARENA_SUPERCLASS(className) \
|
||||
((ArenaClass)SUPERCLASS(className))
|
||||
|
||||
DECLARE_CLASS(AbstractArenaClass, AbstractArenaClass);
|
||||
DECLARE_CLASS(AbstractArena, AbstractArena);
|
||||
extern Bool ArenaClassCheck(ArenaClass class);
|
||||
|
||||
extern Bool ArenaCheck(Arena arena);
|
||||
|
|
@ -699,15 +699,15 @@ extern void SegSetBuffer(Seg seg, Buffer buffer);
|
|||
extern Bool SegCheck(Seg seg);
|
||||
extern Bool GCSegCheck(GCSeg gcseg);
|
||||
extern Bool SegClassCheck(SegClass class);
|
||||
DECLARE_CLASS(SegClass, SegClass);
|
||||
DECLARE_CLASS(SegClass, GCSegClass);
|
||||
DECLARE_CLASS(Seg, Seg);
|
||||
DECLARE_CLASS(Seg, GCSeg);
|
||||
extern void SegClassMixInNoSplitMerge(SegClass class);
|
||||
|
||||
|
||||
/* DEFINE_SEG_CLASS -- define a segment class */
|
||||
|
||||
#define DEFINE_SEG_CLASS(className, var) \
|
||||
DEFINE_ALIAS_CLASS(className, SegClass, var)
|
||||
DEFINE_ALIAS_CLASS(className, Seg, var)
|
||||
|
||||
|
||||
#define SEG_SUPERCLASS(className) \
|
||||
|
|
@ -823,15 +823,15 @@ extern void BufferFrameSetState(Buffer buffer, FrameState state);
|
|||
/* DEFINE_BUFFER_CLASS -- define a buffer class */
|
||||
|
||||
#define DEFINE_BUFFER_CLASS(className, var) \
|
||||
DEFINE_ALIAS_CLASS(className, BufferClass, var)
|
||||
DEFINE_ALIAS_CLASS(className, Buffer, var)
|
||||
|
||||
#define BUFFER_SUPERCLASS(className) \
|
||||
((BufferClass)SUPERCLASS(className))
|
||||
|
||||
extern Bool BufferClassCheck(BufferClass class);
|
||||
DECLARE_CLASS(BufferClass, BufferClass);
|
||||
DECLARE_CLASS(BufferClass, SegBufClass);
|
||||
DECLARE_CLASS(BufferClass, RankBufClass);
|
||||
DECLARE_CLASS(Buffer, Buffer);
|
||||
DECLARE_CLASS(Buffer, SegBuf);
|
||||
DECLARE_CLASS(Buffer, RankBuf);
|
||||
|
||||
extern AllocPattern AllocPatternRamp(void);
|
||||
extern AllocPattern AllocPatternRampCollectAll(void);
|
||||
|
|
@ -1024,10 +1024,10 @@ extern Bool LandFlush(Land dest, Land src);
|
|||
|
||||
extern Size LandSlowSize(Land land);
|
||||
extern Bool LandClassCheck(LandClass class);
|
||||
DECLARE_CLASS(LandClass, LandClass);
|
||||
DECLARE_CLASS(Land, Land);
|
||||
#define LAND_SUPERCLASS(className) ((LandClass)SUPERCLASS(className))
|
||||
#define DEFINE_LAND_CLASS(className, var) \
|
||||
DEFINE_ALIAS_CLASS(className, LandClass, var)
|
||||
DEFINE_ALIAS_CLASS(className, Land, var)
|
||||
#define IsLandSubclass(land, className) \
|
||||
IsSubclassPoly((land)->class, className ## Get())
|
||||
|
||||
|
|
|
|||
|
|
@ -111,9 +111,9 @@ void PoolClassMixInCollect(PoolClass class)
|
|||
/* Classes */
|
||||
|
||||
|
||||
DEFINE_CLASS(AbstractPoolClass, class)
|
||||
DEFINE_CLASS(AbstractPool, class)
|
||||
{
|
||||
INHERIT_CLASS(&class->protocol, AbstractPoolClass, InstClass);
|
||||
INHERIT_CLASS(&class->protocol, AbstractPool, Inst);
|
||||
class->size = 0;
|
||||
class->attr = 0;
|
||||
class->varargs = ArgTrivVarargs;
|
||||
|
|
@ -149,27 +149,27 @@ DEFINE_CLASS(AbstractPoolClass, class)
|
|||
class->sig = PoolClassSig;
|
||||
}
|
||||
|
||||
DEFINE_CLASS(AbstractBufferPoolClass, class)
|
||||
DEFINE_CLASS(AbstractBufferPool, class)
|
||||
{
|
||||
INHERIT_CLASS(class, AbstractBufferPoolClass, AbstractPoolClass);
|
||||
INHERIT_CLASS(class, AbstractBufferPool, AbstractPool);
|
||||
PoolClassMixInBuffer(class);
|
||||
}
|
||||
|
||||
DEFINE_CLASS(AbstractSegBufPoolClass, class)
|
||||
DEFINE_CLASS(AbstractSegBufPool, class)
|
||||
{
|
||||
INHERIT_CLASS(class, AbstractSegBufPoolClass, AbstractBufferPoolClass);
|
||||
INHERIT_CLASS(class, AbstractSegBufPool, AbstractBufferPool);
|
||||
class->bufferClass = SegBufClassGet;
|
||||
}
|
||||
|
||||
DEFINE_CLASS(AbstractScanPoolClass, class)
|
||||
DEFINE_CLASS(AbstractScanPool, class)
|
||||
{
|
||||
INHERIT_CLASS(class, AbstractScanPoolClass, AbstractSegBufPoolClass);
|
||||
INHERIT_CLASS(class, AbstractScanPool, AbstractSegBufPool);
|
||||
PoolClassMixInScan(class);
|
||||
}
|
||||
|
||||
DEFINE_CLASS(AbstractCollectPoolClass, class)
|
||||
DEFINE_CLASS(AbstractCollectPool, class)
|
||||
{
|
||||
INHERIT_CLASS(class, AbstractCollectPoolClass, AbstractScanPoolClass);
|
||||
INHERIT_CLASS(class, AbstractCollectPool, AbstractScanPool);
|
||||
PoolClassMixInCollect(class);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -31,9 +31,9 @@ static Bool amcSegHasNailboard(Seg seg);
|
|||
static Nailboard amcSegNailboard(Seg seg);
|
||||
static Bool AMCCheck(AMC amc);
|
||||
static Res AMCFix(Pool pool, ScanState ss, Seg seg, Ref *refIO);
|
||||
DECLARE_CLASS(PoolClass, AMCZPoolClass);
|
||||
DECLARE_CLASS(BufferClass, amcBufClass);
|
||||
DECLARE_CLASS(SegClass, amcSegClass);
|
||||
DECLARE_CLASS(Pool, AMCZPool);
|
||||
DECLARE_CLASS(Buffer, amcBuf);
|
||||
DECLARE_CLASS(Seg, amcSeg);
|
||||
|
||||
|
||||
/* amcGenStruct -- pool AMC generation descriptor */
|
||||
|
|
@ -139,7 +139,7 @@ static Res AMCSegInit(Seg seg, Pool pool, Addr base, Size size, ArgList args)
|
|||
/* no useful checks for base and size */
|
||||
|
||||
/* Initialize the superclass fields first via next-method call */
|
||||
super = SEG_SUPERCLASS(amcSegClass);
|
||||
super = SEG_SUPERCLASS(amcSeg);
|
||||
res = super->init(seg, pool, base, size, args);
|
||||
if(res != ResOK)
|
||||
return res;
|
||||
|
|
@ -252,7 +252,7 @@ static Res AMCSegDescribe(Seg seg, mps_lib_FILE *stream, Count depth)
|
|||
return ResFAIL;
|
||||
|
||||
/* Describe the superclass fields first via next-method call */
|
||||
super = SEG_SUPERCLASS(amcSegClass);
|
||||
super = SEG_SUPERCLASS(amcSeg);
|
||||
res = super->describe(seg, stream, depth);
|
||||
if(res != ResOK)
|
||||
return res;
|
||||
|
|
@ -341,9 +341,9 @@ static Res AMCSegDescribe(Seg seg, mps_lib_FILE *stream, Count depth)
|
|||
|
||||
/* amcSegClass -- Class definition for AMC segments */
|
||||
|
||||
DEFINE_SEG_CLASS(amcSegClass, class)
|
||||
DEFINE_SEG_CLASS(amcSeg, class)
|
||||
{
|
||||
INHERIT_CLASS(class, amcSegClass, GCSegClass);
|
||||
INHERIT_CLASS(class, amcSeg, GCSeg);
|
||||
SegClassMixInNoSplitMerge(class); /* no support for this (yet) */
|
||||
class->size = sizeof(amcSegStruct);
|
||||
class->init = AMCSegInit;
|
||||
|
|
@ -520,7 +520,7 @@ static Res AMCBufInit(Buffer buffer, Pool pool, ArgList args)
|
|||
forHashArrays = arg.val.b;
|
||||
|
||||
/* call next method */
|
||||
superclass = BUFFER_SUPERCLASS(amcBufClass);
|
||||
superclass = BUFFER_SUPERCLASS(amcBuf);
|
||||
res = (*superclass->init)(buffer, pool, args);
|
||||
if(res != ResOK)
|
||||
return res;
|
||||
|
|
@ -557,16 +557,16 @@ static void AMCBufFinish(Buffer buffer)
|
|||
amcbuf->sig = SigInvalid;
|
||||
|
||||
/* Finish the superclass fields last. */
|
||||
super = BUFFER_SUPERCLASS(amcBufClass);
|
||||
super = BUFFER_SUPERCLASS(amcBuf);
|
||||
super->finish(buffer);
|
||||
}
|
||||
|
||||
|
||||
/* amcBufClass -- The class definition */
|
||||
|
||||
DEFINE_BUFFER_CLASS(amcBufClass, class)
|
||||
DEFINE_BUFFER_CLASS(amcBuf, class)
|
||||
{
|
||||
INHERIT_CLASS(class, amcBufClass, SegBufClass);
|
||||
INHERIT_CLASS(class, amcBuf, SegBuf);
|
||||
class->size = sizeof(amcBufStruct);
|
||||
class->init = AMCBufInit;
|
||||
class->finish = AMCBufFinish;
|
||||
|
|
@ -593,7 +593,7 @@ static Res amcGenCreate(amcGen *genReturn, AMC amc, GenDesc gen)
|
|||
goto failControlAlloc;
|
||||
amcgen = (amcGen)p;
|
||||
|
||||
res = BufferCreate(&buffer, CLASS(amcBufClass), pool, FALSE, argsNone);
|
||||
res = BufferCreate(&buffer, CLASS(amcBuf), pool, FALSE, argsNone);
|
||||
if(res != ResOK)
|
||||
goto failBufferCreate;
|
||||
|
||||
|
|
@ -951,7 +951,7 @@ static Res AMCBufferFill(Addr *baseReturn, Addr *limitReturn,
|
|||
}
|
||||
MPS_ARGS_BEGIN(args) {
|
||||
MPS_ARGS_ADD_FIELD(args, amcKeySegGen, p, gen);
|
||||
res = PoolGenAlloc(&seg, pgen, CLASS(amcSegClass), grainsSize, args);
|
||||
res = PoolGenAlloc(&seg, pgen, CLASS(amcSeg), grainsSize, args);
|
||||
} MPS_ARGS_END(args);
|
||||
if(res != ResOK)
|
||||
return res;
|
||||
|
|
@ -1891,7 +1891,7 @@ static void amcWalkAll(Pool pool, FormattedObjectsVisitor f, void *p, size_t s)
|
|||
Arena arena;
|
||||
Ring ring, next, node;
|
||||
|
||||
AVER(IsSubclassPoly(pool->class, CLASS(AMCZPoolClass)));
|
||||
AVER(IsSubclassPoly(pool->class, CLASS(AMCZPool)));
|
||||
|
||||
arena = PoolArena(pool);
|
||||
ring = PoolSegRing(pool);
|
||||
|
|
@ -2102,9 +2102,9 @@ static Res AMCDescribe(Pool pool, mps_lib_FILE *stream, Count depth)
|
|||
|
||||
/* AMCZPoolClass -- the class definition */
|
||||
|
||||
DEFINE_POOL_CLASS(AMCZPoolClass, this)
|
||||
DEFINE_POOL_CLASS(AMCZPool, this)
|
||||
{
|
||||
INHERIT_CLASS(this, AMCZPoolClass, AbstractSegBufPoolClass);
|
||||
INHERIT_CLASS(this, AMCZPool, AbstractSegBufPool);
|
||||
PoolClassMixInFormat(this);
|
||||
PoolClassMixInCollect(this);
|
||||
this->size = sizeof(AMCStruct);
|
||||
|
|
@ -2132,9 +2132,9 @@ DEFINE_POOL_CLASS(AMCZPoolClass, this)
|
|||
|
||||
/* AMCPoolClass -- the class definition */
|
||||
|
||||
DEFINE_POOL_CLASS(AMCPoolClass, this)
|
||||
DEFINE_POOL_CLASS(AMCPool, this)
|
||||
{
|
||||
INHERIT_CLASS(this, AMCPoolClass, AMCZPoolClass);
|
||||
INHERIT_CLASS(this, AMCPool, AMCZPool);
|
||||
PoolClassMixInScan(this);
|
||||
this->init = AMCInit;
|
||||
this->scan = AMCScan;
|
||||
|
|
@ -2146,14 +2146,14 @@ DEFINE_POOL_CLASS(AMCPoolClass, this)
|
|||
|
||||
mps_pool_class_t mps_class_amc(void)
|
||||
{
|
||||
return (mps_pool_class_t)CLASS(AMCPoolClass);
|
||||
return (mps_pool_class_t)CLASS(AMCPool);
|
||||
}
|
||||
|
||||
/* mps_class_amcz -- return the pool class descriptor to the client */
|
||||
|
||||
mps_pool_class_t mps_class_amcz(void)
|
||||
{
|
||||
return (mps_pool_class_t)CLASS(AMCZPoolClass);
|
||||
return (mps_pool_class_t)CLASS(AMCZPool);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -2218,7 +2218,7 @@ static Bool AMCCheck(AMC amc)
|
|||
{
|
||||
CHECKS(AMC, amc);
|
||||
CHECKD(Pool, AMCPool(amc));
|
||||
CHECKL(IsSubclassPoly(AMCPool(amc)->class, CLASS(AMCZPoolClass)));
|
||||
CHECKL(IsSubclassPoly(AMCPool(amc)->class, CLASS(AMCZPool)));
|
||||
CHECKL(RankSetCheck(amc->rankSet));
|
||||
CHECKD_NOSIG(Ring, &amc->genRing);
|
||||
CHECKL(BoolCheck(amc->gensBooted));
|
||||
|
|
|
|||
|
|
@ -232,7 +232,7 @@ static Res AMSSegInit(Seg seg, Pool pool, Addr base, Size size, ArgList args)
|
|||
/* no useful checks for base and size */
|
||||
|
||||
/* Initialize the superclass fields first via next-method call */
|
||||
super = SEG_SUPERCLASS(AMSSegClass);
|
||||
super = SEG_SUPERCLASS(AMSSeg);
|
||||
res = super->init(seg, pool, base, size, args);
|
||||
if (res != ResOK)
|
||||
goto failNextMethod;
|
||||
|
|
@ -299,7 +299,7 @@ static void AMSSegFinish(Seg seg)
|
|||
amsseg->sig = SigInvalid;
|
||||
|
||||
/* finish the superclass fields last */
|
||||
super = SEG_SUPERCLASS(AMSSegClass);
|
||||
super = SEG_SUPERCLASS(AMSSeg);
|
||||
super->finish(seg);
|
||||
}
|
||||
|
||||
|
|
@ -363,7 +363,7 @@ static Res AMSSegMerge(Seg seg, Seg segHi,
|
|||
goto failCreateTables;
|
||||
|
||||
/* Merge the superclass fields via next-method call */
|
||||
super = SEG_SUPERCLASS(AMSSegClass);
|
||||
super = SEG_SUPERCLASS(AMSSeg);
|
||||
res = super->merge(seg, segHi, base, mid, limit);
|
||||
if (res != ResOK)
|
||||
goto failSuper;
|
||||
|
|
@ -456,7 +456,7 @@ static Res AMSSegSplit(Seg seg, Seg segHi,
|
|||
|
||||
|
||||
/* Split the superclass fields via next-method call */
|
||||
super = SEG_SUPERCLASS(AMSSegClass);
|
||||
super = SEG_SUPERCLASS(AMSSeg);
|
||||
res = super->split(seg, segHi, base, mid, limit);
|
||||
if (res != ResOK)
|
||||
goto failSuper;
|
||||
|
|
@ -544,7 +544,7 @@ static Res AMSSegDescribe(Seg seg, mps_lib_FILE *stream, Count depth)
|
|||
return ResFAIL;
|
||||
|
||||
/* Describe the superclass fields first via next-method call */
|
||||
super = SEG_SUPERCLASS(AMSSegClass);
|
||||
super = SEG_SUPERCLASS(AMSSeg);
|
||||
res = super->describe(seg, stream, depth);
|
||||
if (res != ResOK)
|
||||
return res;
|
||||
|
|
@ -623,9 +623,9 @@ static Res AMSSegDescribe(Seg seg, mps_lib_FILE *stream, Count depth)
|
|||
|
||||
/* AMSSegClass -- Class definition for AMS segments */
|
||||
|
||||
DEFINE_CLASS(AMSSegClass, class)
|
||||
DEFINE_CLASS(AMSSeg, class)
|
||||
{
|
||||
INHERIT_CLASS(class, AMSSegClass, GCSegClass);
|
||||
INHERIT_CLASS(class, AMSSeg, GCSeg);
|
||||
class->size = sizeof(AMSSegStruct);
|
||||
class->init = AMSSegInit;
|
||||
class->finish = AMSSegFinish;
|
||||
|
|
@ -1746,9 +1746,9 @@ static Res AMSDescribe(Pool pool, mps_lib_FILE *stream, Count depth)
|
|||
/* <code/poolams.h> contains the type definition. Hence the use */
|
||||
/* of DEFINE_CLASS rather than DEFINE_POOL_CLASS */
|
||||
|
||||
DEFINE_CLASS(AMSPoolClass, this)
|
||||
DEFINE_CLASS(AMSPool, this)
|
||||
{
|
||||
INHERIT_CLASS(this, AMSPoolClass, AbstractCollectPoolClass);
|
||||
INHERIT_CLASS(this, AMSPool, AbstractCollectPool);
|
||||
PoolClassMixInFormat(this);
|
||||
this->size = sizeof(AMSStruct);
|
||||
this->varargs = AMSVarargs;
|
||||
|
|
@ -1788,9 +1788,9 @@ static PoolDebugMixin AMSDebugMixin(Pool pool)
|
|||
|
||||
/* AMSDebugPoolClass -- the class definition for the debug version */
|
||||
|
||||
DEFINE_POOL_CLASS(AMSDebugPoolClass, this)
|
||||
DEFINE_POOL_CLASS(AMSDebugPool, this)
|
||||
{
|
||||
INHERIT_CLASS(this, AMSDebugPoolClass, AMSPoolClass);
|
||||
INHERIT_CLASS(this, AMSDebugPool, AMSPool);
|
||||
PoolClassMixInDebug(this);
|
||||
this->size = sizeof(AMSDebugStruct);
|
||||
this->varargs = AMSDebugVarargs;
|
||||
|
|
@ -1803,7 +1803,7 @@ DEFINE_POOL_CLASS(AMSDebugPoolClass, this)
|
|||
|
||||
mps_pool_class_t mps_class_ams(void)
|
||||
{
|
||||
return (mps_pool_class_t)CLASS(AMSPoolClass);
|
||||
return (mps_pool_class_t)CLASS(AMSPool);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1811,7 +1811,7 @@ mps_pool_class_t mps_class_ams(void)
|
|||
|
||||
mps_pool_class_t mps_class_ams_debug(void)
|
||||
{
|
||||
return (mps_pool_class_t)CLASS(AMSDebugPoolClass);
|
||||
return (mps_pool_class_t)CLASS(AMSDebugPool);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1821,7 +1821,7 @@ Bool AMSCheck(AMS ams)
|
|||
{
|
||||
CHECKS(AMS, ams);
|
||||
CHECKD(Pool, AMSPool(ams));
|
||||
CHECKL(IsSubclassPoly(AMSPool(ams)->class, CLASS(AMSPoolClass)));
|
||||
CHECKL(IsSubclassPoly(AMSPool(ams)->class, CLASS(AMSPool)));
|
||||
CHECKL(PoolAlignment(AMSPool(ams)) == AMSGrainsSize(ams, (Size)1));
|
||||
CHECKL(PoolAlignment(AMSPool(ams)) == AMSPool(ams)->format->alignment);
|
||||
CHECKD(PoolGen, &ams->pgen);
|
||||
|
|
|
|||
|
|
@ -182,15 +182,15 @@ extern void AMSSegFreeCheck(AMSSeg amsseg);
|
|||
|
||||
typedef SegClass AMSSegClass;
|
||||
typedef SegClassStruct AMSSegClassStruct;
|
||||
DECLARE_CLASS(AMSSegClass, AMSSegClass);
|
||||
DECLARE_CLASS(AMSSeg, AMSSeg);
|
||||
extern Bool AMSSegCheck(AMSSeg seg);
|
||||
|
||||
|
||||
typedef PoolClass AMSPoolClass;
|
||||
typedef PoolClassStruct AMSPoolClassStruct;
|
||||
|
||||
DECLARE_CLASS(AMSPoolClass, AMSPoolClass);
|
||||
DECLARE_CLASS(AMSPoolClass, AMSDebugPoolClass);
|
||||
DECLARE_CLASS(AMSPool, AMSPool);
|
||||
DECLARE_CLASS(AMSPool, AMSDebugPool);
|
||||
|
||||
|
||||
#endif /* poolams_h */
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@ typedef struct AWLSegStruct {
|
|||
#define AWLSeg2Seg(awlseg) ((Seg)(awlseg))
|
||||
|
||||
|
||||
DECLARE_CLASS(SegClass, AWLSegClass);
|
||||
DECLARE_CLASS(Seg, AWLSeg);
|
||||
|
||||
|
||||
ATTRIBUTE_UNUSED
|
||||
|
|
@ -201,7 +201,7 @@ static Res AWLSegInit(Seg seg, Pool pool, Addr base, Size size, ArgList args)
|
|||
AVERT(AWL, awl);
|
||||
|
||||
/* Initialize the superclass fields first via next-method call */
|
||||
super = SEG_SUPERCLASS(AWLSegClass);
|
||||
super = SEG_SUPERCLASS(AWLSeg);
|
||||
res = super->init(seg, pool, base, size, args);
|
||||
if (res != ResOK)
|
||||
return res;
|
||||
|
|
@ -277,16 +277,16 @@ static void AWLSegFinish(Seg seg)
|
|||
awlseg->sig = SigInvalid;
|
||||
|
||||
/* finish the superclass fields last */
|
||||
super = SEG_SUPERCLASS(AWLSegClass);
|
||||
super = SEG_SUPERCLASS(AWLSeg);
|
||||
super->finish(seg);
|
||||
}
|
||||
|
||||
|
||||
/* AWLSegClass -- Class definition for AWL segments */
|
||||
|
||||
DEFINE_SEG_CLASS(AWLSegClass, class)
|
||||
DEFINE_SEG_CLASS(AWLSeg, class)
|
||||
{
|
||||
INHERIT_CLASS(class, AWLSegClass, GCSegClass);
|
||||
INHERIT_CLASS(class, AWLSeg, GCSeg);
|
||||
SegClassMixInNoSplitMerge(class); /* no support for this (yet) */
|
||||
class->size = sizeof(AWLSegStruct);
|
||||
class->init = AWLSegInit;
|
||||
|
|
@ -473,7 +473,7 @@ static Res AWLSegCreate(AWLSeg *awlsegReturn,
|
|||
return ResMEMORY;
|
||||
MPS_ARGS_BEGIN(args) {
|
||||
MPS_ARGS_ADD_FIELD(args, awlKeySegRankSet, u, rankSet);
|
||||
res = PoolGenAlloc(&seg, &awl->pgen, CLASS(AWLSegClass), size, args);
|
||||
res = PoolGenAlloc(&seg, &awl->pgen, CLASS(AWLSeg), size, args);
|
||||
} MPS_ARGS_END(args);
|
||||
if (res != ResOK)
|
||||
return res;
|
||||
|
|
@ -1317,9 +1317,9 @@ static Size AWLFreeSize(Pool pool)
|
|||
|
||||
/* AWLPoolClass -- the class definition */
|
||||
|
||||
DEFINE_POOL_CLASS(AWLPoolClass, this)
|
||||
DEFINE_POOL_CLASS(AWLPool, this)
|
||||
{
|
||||
INHERIT_CLASS(this, AWLPoolClass, AbstractCollectPoolClass);
|
||||
INHERIT_CLASS(this, AWLPool, AbstractCollectPool);
|
||||
PoolClassMixInFormat(this);
|
||||
this->size = sizeof(AWLStruct);
|
||||
this->varargs = AWLVarargs;
|
||||
|
|
@ -1345,7 +1345,7 @@ DEFINE_POOL_CLASS(AWLPoolClass, this)
|
|||
|
||||
mps_pool_class_t mps_class_awl(void)
|
||||
{
|
||||
return (mps_pool_class_t)CLASS(AWLPoolClass);
|
||||
return (mps_pool_class_t)CLASS(AWLPool);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1356,7 +1356,7 @@ static Bool AWLCheck(AWL awl)
|
|||
{
|
||||
CHECKS(AWL, awl);
|
||||
CHECKD(Pool, AWLPool(awl));
|
||||
CHECKL(AWLPool(awl)->class == CLASS(AWLPoolClass));
|
||||
CHECKL(AWLPool(awl)->class == CLASS(AWLPool));
|
||||
CHECKL(AWLGrainsSize(awl, (Count)1) == PoolAlignment(AWLPool(awl)));
|
||||
/* Nothing to check about succAccesses. */
|
||||
CHECKL(FUNCHECK(awl->findDependent));
|
||||
|
|
|
|||
|
|
@ -66,9 +66,9 @@ static Count loSegGrains(LOSeg loseg);
|
|||
|
||||
/* LOSegClass -- Class definition for LO segments */
|
||||
|
||||
DEFINE_SEG_CLASS(LOSegClass, class)
|
||||
DEFINE_SEG_CLASS(LOSeg, class)
|
||||
{
|
||||
INHERIT_CLASS(class, LOSegClass, GCSegClass);
|
||||
INHERIT_CLASS(class, LOSeg, GCSeg);
|
||||
SegClassMixInNoSplitMerge(class);
|
||||
class->size = sizeof(LOSegStruct);
|
||||
class->init = loSegInit;
|
||||
|
|
@ -117,7 +117,7 @@ static Res loSegInit(Seg seg, Pool pool, Addr base, Size size, ArgList args)
|
|||
AVERT(LO, lo);
|
||||
|
||||
/* Initialize the superclass fields first via next-method call */
|
||||
super = SEG_SUPERCLASS(LOSegClass);
|
||||
super = SEG_SUPERCLASS(LOSeg);
|
||||
res = super->init(seg, pool, base, size, args);
|
||||
if(res != ResOK)
|
||||
return res;
|
||||
|
|
@ -179,7 +179,7 @@ static void loSegFinish(Seg seg)
|
|||
loseg->sig = SigInvalid;
|
||||
|
||||
/* finish the superclass fields last */
|
||||
super = SEG_SUPERCLASS(LOSegClass);
|
||||
super = SEG_SUPERCLASS(LOSeg);
|
||||
super->finish(seg);
|
||||
}
|
||||
|
||||
|
|
@ -288,7 +288,7 @@ static Res loSegCreate(LOSeg *loSegReturn, Pool pool, Size size)
|
|||
lo = PoolPoolLO(pool);
|
||||
AVERT(LO, lo);
|
||||
|
||||
res = PoolGenAlloc(&seg, &lo->pgen, CLASS(LOSegClass),
|
||||
res = PoolGenAlloc(&seg, &lo->pgen, CLASS(LOSeg),
|
||||
SizeArenaGrains(size, PoolArena(pool)),
|
||||
argsNone);
|
||||
if (res != ResOK)
|
||||
|
|
@ -818,9 +818,9 @@ static Size LOFreeSize(Pool pool)
|
|||
|
||||
/* LOPoolClass -- the class definition */
|
||||
|
||||
DEFINE_POOL_CLASS(LOPoolClass, this)
|
||||
DEFINE_POOL_CLASS(LOPool, this)
|
||||
{
|
||||
INHERIT_CLASS(this, LOPoolClass, AbstractSegBufPoolClass);
|
||||
INHERIT_CLASS(this, LOPool, AbstractSegBufPool);
|
||||
PoolClassMixInFormat(this);
|
||||
PoolClassMixInCollect(this);
|
||||
this->size = sizeof(LOStruct);
|
||||
|
|
@ -844,7 +844,7 @@ DEFINE_POOL_CLASS(LOPoolClass, this)
|
|||
|
||||
mps_pool_class_t mps_class_lo(void)
|
||||
{
|
||||
return (mps_pool_class_t)CLASS(LOPoolClass);
|
||||
return (mps_pool_class_t)CLASS(LOPool);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -855,7 +855,7 @@ static Bool LOCheck(LO lo)
|
|||
{
|
||||
CHECKS(LO, lo);
|
||||
CHECKD(Pool, LOPool(lo));
|
||||
CHECKL(LOPool(lo)->class == CLASS(LOPoolClass));
|
||||
CHECKL(LOPool(lo)->class == CLASS(LOPool));
|
||||
CHECKL(ShiftCheck(lo->alignShift));
|
||||
CHECKL(LOGrainsSize(lo, (Count)1) == PoolAlignment(LOPool(lo)));
|
||||
CHECKD(PoolGen, &lo->pgen);
|
||||
|
|
|
|||
|
|
@ -356,9 +356,9 @@ static Res MFSDescribe(Pool pool, mps_lib_FILE *stream, Count depth)
|
|||
}
|
||||
|
||||
|
||||
DEFINE_POOL_CLASS(MFSPoolClass, this)
|
||||
DEFINE_POOL_CLASS(MFSPool, this)
|
||||
{
|
||||
INHERIT_CLASS(this, MFSPoolClass, AbstractPoolClass);
|
||||
INHERIT_CLASS(this, MFSPool, AbstractPool);
|
||||
this->size = sizeof(MFSStruct);
|
||||
this->varargs = MFSVarargs;
|
||||
this->init = MFSInit;
|
||||
|
|
@ -374,7 +374,7 @@ DEFINE_POOL_CLASS(MFSPoolClass, this)
|
|||
|
||||
PoolClass PoolClassMFS(void)
|
||||
{
|
||||
return CLASS(MFSPoolClass);
|
||||
return CLASS(MFSPool);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -390,7 +390,7 @@ Bool MFSCheck(MFS mfs)
|
|||
|
||||
CHECKS(MFS, mfs);
|
||||
CHECKD(Pool, MFSPool(mfs));
|
||||
CHECKL(MFSPool(mfs)->class == CLASS(MFSPoolClass));
|
||||
CHECKL(MFSPool(mfs)->class == CLASS(MFSPool));
|
||||
CHECKL(mfs->unitSize >= UNIT_MIN);
|
||||
CHECKL(mfs->extendBy >= UNIT_MIN);
|
||||
CHECKL(BoolCheck(mfs->extendSelf));
|
||||
|
|
|
|||
|
|
@ -169,8 +169,8 @@ typedef struct MRGRefSegStruct {
|
|||
|
||||
/* forward declarations */
|
||||
|
||||
DECLARE_CLASS(SegClass, MRGLinkSegClass);
|
||||
DECLARE_CLASS(SegClass, MRGRefSegClass);
|
||||
DECLARE_CLASS(Seg, MRGLinkSeg);
|
||||
DECLARE_CLASS(Seg, MRGRefSeg);
|
||||
|
||||
|
||||
/* MRGLinkSegCheck -- check a link segment
|
||||
|
|
@ -230,7 +230,7 @@ static Res MRGLinkSegInit(Seg seg, Pool pool, Addr base, Size size,
|
|||
/* no useful checks for base and size */
|
||||
|
||||
/* Initialize the superclass fields first via next-method call */
|
||||
super = SEG_SUPERCLASS(MRGLinkSegClass);
|
||||
super = SEG_SUPERCLASS(MRGLinkSeg);
|
||||
res = super->init(seg, pool, base, size, args);
|
||||
if (res != ResOK)
|
||||
return res;
|
||||
|
|
@ -272,7 +272,7 @@ static Res MRGRefSegInit(Seg seg, Pool pool, Addr base, Size size, ArgList args)
|
|||
AVERT(MRGLinkSeg, linkseg);
|
||||
|
||||
/* Initialize the superclass fields first via next-method call */
|
||||
super = SEG_SUPERCLASS(MRGRefSegClass);
|
||||
super = SEG_SUPERCLASS(MRGRefSeg);
|
||||
res = super->init(seg, pool, base, size, args);
|
||||
if (res != ResOK)
|
||||
return res;
|
||||
|
|
@ -296,9 +296,9 @@ static Res MRGRefSegInit(Seg seg, Pool pool, Addr base, Size size, ArgList args)
|
|||
|
||||
/* MRGLinkSegClass -- Class definition */
|
||||
|
||||
DEFINE_SEG_CLASS(MRGLinkSegClass, class)
|
||||
DEFINE_SEG_CLASS(MRGLinkSeg, class)
|
||||
{
|
||||
INHERIT_CLASS(class, MRGLinkSegClass, SegClass);
|
||||
INHERIT_CLASS(class, MRGLinkSeg, Seg);
|
||||
SegClassMixInNoSplitMerge(class); /* no support for this */
|
||||
class->size = sizeof(MRGLinkSegStruct);
|
||||
class->init = MRGLinkSegInit;
|
||||
|
|
@ -308,9 +308,9 @@ DEFINE_SEG_CLASS(MRGLinkSegClass, class)
|
|||
|
||||
/* MRGRefSegClass -- Class definition */
|
||||
|
||||
DEFINE_SEG_CLASS(MRGRefSegClass, class)
|
||||
DEFINE_SEG_CLASS(MRGRefSeg, class)
|
||||
{
|
||||
INHERIT_CLASS(class, MRGRefSegClass, GCSegClass);
|
||||
INHERIT_CLASS(class, MRGRefSeg, GCSeg);
|
||||
SegClassMixInNoSplitMerge(class); /* no support for this */
|
||||
class->size = sizeof(MRGRefSegStruct);
|
||||
class->init = MRGRefSegInit;
|
||||
|
|
@ -517,7 +517,7 @@ static Res MRGSegPairCreate(MRGRefSeg *refSegReturn, MRG mrg)
|
|||
linkSegSize = nGuardians * sizeof(LinkStruct);
|
||||
linkSegSize = SizeArenaGrains(linkSegSize, arena);
|
||||
|
||||
res = SegAlloc(&segLink, CLASS(MRGLinkSegClass),
|
||||
res = SegAlloc(&segLink, CLASS(MRGLinkSeg),
|
||||
LocusPrefDefault(), linkSegSize, pool,
|
||||
argsNone);
|
||||
if (res != ResOK)
|
||||
|
|
@ -526,7 +526,7 @@ static Res MRGSegPairCreate(MRGRefSeg *refSegReturn, MRG mrg)
|
|||
|
||||
MPS_ARGS_BEGIN(args) {
|
||||
MPS_ARGS_ADD_FIELD(args, mrgKeyLinkSeg, p, linkseg); /* .ref.initarg */
|
||||
res = SegAlloc(&segRefPart, CLASS(MRGRefSegClass),
|
||||
res = SegAlloc(&segRefPart, CLASS(MRGRefSeg),
|
||||
LocusPrefDefault(), mrg->extendBy, pool,
|
||||
args);
|
||||
} MPS_ARGS_END(args);
|
||||
|
|
@ -867,9 +867,9 @@ static Res MRGScan(Bool *totalReturn, ScanState ss, Pool pool, Seg seg)
|
|||
}
|
||||
|
||||
|
||||
DEFINE_POOL_CLASS(MRGPoolClass, this)
|
||||
DEFINE_POOL_CLASS(MRGPool, this)
|
||||
{
|
||||
INHERIT_CLASS(this, MRGPoolClass, AbstractPoolClass);
|
||||
INHERIT_CLASS(this, MRGPool, AbstractPool);
|
||||
this->size = sizeof(MRGStruct);
|
||||
this->init = MRGInit;
|
||||
this->finish = MRGFinish;
|
||||
|
|
@ -883,7 +883,7 @@ DEFINE_POOL_CLASS(MRGPoolClass, this)
|
|||
|
||||
PoolClass PoolClassMRG(void)
|
||||
{
|
||||
return CLASS(MRGPoolClass);
|
||||
return CLASS(MRGPool);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -842,9 +842,9 @@ static Res MVDescribe(Pool pool, mps_lib_FILE *stream, Count depth)
|
|||
/* Pool class MV */
|
||||
|
||||
|
||||
DEFINE_POOL_CLASS(MVPoolClass, this)
|
||||
DEFINE_POOL_CLASS(MVPool, this)
|
||||
{
|
||||
INHERIT_CLASS(this, MVPoolClass, AbstractBufferPoolClass);
|
||||
INHERIT_CLASS(this, MVPool, AbstractBufferPool);
|
||||
this->size = sizeof(MVStruct);
|
||||
this->varargs = MVVarargs;
|
||||
this->init = MVInit;
|
||||
|
|
@ -860,15 +860,15 @@ DEFINE_POOL_CLASS(MVPoolClass, this)
|
|||
|
||||
MVPoolClass PoolClassMV(void)
|
||||
{
|
||||
return CLASS(MVPoolClass);
|
||||
return CLASS(MVPool);
|
||||
}
|
||||
|
||||
|
||||
/* Pool class MVDebug */
|
||||
|
||||
DEFINE_POOL_CLASS(MVDebugPoolClass, this)
|
||||
DEFINE_POOL_CLASS(MVDebugPool, this)
|
||||
{
|
||||
INHERIT_CLASS(this, MVDebugPoolClass, MVPoolClass);
|
||||
INHERIT_CLASS(this, MVDebugPool, MVPool);
|
||||
PoolClassMixInDebug(this);
|
||||
this->size = sizeof(MVDebugStruct);
|
||||
this->varargs = MVDebugVarargs;
|
||||
|
|
@ -884,12 +884,12 @@ DEFINE_POOL_CLASS(MVDebugPoolClass, this)
|
|||
|
||||
mps_pool_class_t mps_class_mv(void)
|
||||
{
|
||||
return (mps_pool_class_t)CLASS(MVPoolClass);
|
||||
return (mps_pool_class_t)CLASS(MVPool);
|
||||
}
|
||||
|
||||
mps_pool_class_t mps_class_mv_debug(void)
|
||||
{
|
||||
return (mps_pool_class_t)CLASS(MVDebugPoolClass);
|
||||
return (mps_pool_class_t)CLASS(MVDebugPool);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -899,7 +899,7 @@ Bool MVCheck(MV mv)
|
|||
{
|
||||
CHECKS(MV, mv);
|
||||
CHECKD(Pool, MVPool(mv));
|
||||
CHECKL(IsSubclassPoly(MVPool(mv)->class, CLASS(MVPoolClass)));
|
||||
CHECKL(IsSubclassPoly(MVPool(mv)->class, CLASS(MVPool)));
|
||||
CHECKD(MFS, &mv->blockPoolStruct);
|
||||
CHECKD(MFS, &mv->spanPoolStruct);
|
||||
CHECKL(mv->extendBy > 0);
|
||||
|
|
|
|||
|
|
@ -133,9 +133,9 @@ typedef struct MVTStruct
|
|||
} MVTStruct;
|
||||
|
||||
|
||||
DEFINE_POOL_CLASS(MVTPoolClass, this)
|
||||
DEFINE_POOL_CLASS(MVTPool, this)
|
||||
{
|
||||
INHERIT_CLASS(this, MVTPoolClass, AbstractBufferPoolClass);
|
||||
INHERIT_CLASS(this, MVTPool, AbstractBufferPool);
|
||||
this->size = sizeof(MVTStruct);
|
||||
this->varargs = MVTVarargs;
|
||||
this->init = MVTInit;
|
||||
|
|
@ -277,12 +277,12 @@ static Res MVTInit(Pool pool, ArgList args)
|
|||
if (abqDepth < 3)
|
||||
abqDepth = 3;
|
||||
|
||||
res = LandInit(MVTFreePrimary(mvt), CLASS(CBSFastLandClass), arena, align, mvt,
|
||||
res = LandInit(MVTFreePrimary(mvt), CLASS(CBSFastLand), arena, align, mvt,
|
||||
mps_args_none);
|
||||
if (res != ResOK)
|
||||
goto failFreePrimaryInit;
|
||||
|
||||
res = LandInit(MVTFreeSecondary(mvt), CLASS(FreelistLandClass), arena, align,
|
||||
res = LandInit(MVTFreeSecondary(mvt), CLASS(FreelistLand), arena, align,
|
||||
mvt, mps_args_none);
|
||||
if (res != ResOK)
|
||||
goto failFreeSecondaryInit;
|
||||
|
|
@ -290,7 +290,7 @@ static Res MVTInit(Pool pool, ArgList args)
|
|||
MPS_ARGS_BEGIN(foArgs) {
|
||||
MPS_ARGS_ADD(foArgs, FailoverPrimary, MVTFreePrimary(mvt));
|
||||
MPS_ARGS_ADD(foArgs, FailoverSecondary, MVTFreeSecondary(mvt));
|
||||
res = LandInit(MVTFreeLand(mvt), CLASS(FailoverLandClass), arena, align, mvt,
|
||||
res = LandInit(MVTFreeLand(mvt), CLASS(FailoverLand), arena, align, mvt,
|
||||
foArgs);
|
||||
} MPS_ARGS_END(foArgs);
|
||||
if (res != ResOK)
|
||||
|
|
@ -381,7 +381,7 @@ static Bool MVTCheck(MVT mvt)
|
|||
{
|
||||
CHECKS(MVT, mvt);
|
||||
CHECKD(Pool, MVTPool(mvt));
|
||||
CHECKL(MVTPool(mvt)->class == CLASS(MVTPoolClass));
|
||||
CHECKL(MVTPool(mvt)->class == CLASS(MVTPool));
|
||||
CHECKD(CBS, &mvt->cbsStruct);
|
||||
CHECKD(ABQ, &mvt->abqStruct);
|
||||
CHECKD(Freelist, &mvt->flStruct);
|
||||
|
|
@ -1104,7 +1104,7 @@ static Res MVTDescribe(Pool pool, mps_lib_FILE *stream, Count depth)
|
|||
|
||||
PoolClass PoolClassMVT(void)
|
||||
{
|
||||
return CLASS(MVTPoolClass);
|
||||
return CLASS(MVTPool);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1127,7 +1127,7 @@ mps_pool_class_t mps_class_mvt(void)
|
|||
*/
|
||||
static Res MVTSegAlloc(Seg *segReturn, MVT mvt, Size size)
|
||||
{
|
||||
Res res = SegAlloc(segReturn, CLASS(SegClass), LocusPrefDefault(), size,
|
||||
Res res = SegAlloc(segReturn, CLASS(Seg), LocusPrefDefault(), size,
|
||||
MVTPool(mvt), argsNone);
|
||||
|
||||
if (res == ResOK) {
|
||||
|
|
|
|||
|
|
@ -522,7 +522,7 @@ static Res MVFFInit(Pool pool, ArgList args)
|
|||
|
||||
MPS_ARGS_BEGIN(liArgs) {
|
||||
MPS_ARGS_ADD(liArgs, CBSBlockPool, MVFFBlockPool(mvff));
|
||||
res = LandInit(MVFFTotalLand(mvff), CLASS(CBSFastLandClass), arena, align,
|
||||
res = LandInit(MVFFTotalLand(mvff), CLASS(CBSFastLand), arena, align,
|
||||
mvff, liArgs);
|
||||
} MPS_ARGS_END(liArgs);
|
||||
if (res != ResOK)
|
||||
|
|
@ -530,13 +530,13 @@ static Res MVFFInit(Pool pool, ArgList args)
|
|||
|
||||
MPS_ARGS_BEGIN(liArgs) {
|
||||
MPS_ARGS_ADD(liArgs, CBSBlockPool, MVFFBlockPool(mvff));
|
||||
res = LandInit(MVFFFreePrimary(mvff), CLASS(CBSFastLandClass), arena, align,
|
||||
res = LandInit(MVFFFreePrimary(mvff), CLASS(CBSFastLand), arena, align,
|
||||
mvff, liArgs);
|
||||
} MPS_ARGS_END(liArgs);
|
||||
if (res != ResOK)
|
||||
goto failFreePrimaryInit;
|
||||
|
||||
res = LandInit(MVFFFreeSecondary(mvff), CLASS(FreelistLandClass), arena, align,
|
||||
res = LandInit(MVFFFreeSecondary(mvff), CLASS(FreelistLand), arena, align,
|
||||
mvff, mps_args_none);
|
||||
if (res != ResOK)
|
||||
goto failFreeSecondaryInit;
|
||||
|
|
@ -544,7 +544,7 @@ static Res MVFFInit(Pool pool, ArgList args)
|
|||
MPS_ARGS_BEGIN(foArgs) {
|
||||
MPS_ARGS_ADD(foArgs, FailoverPrimary, MVFFFreePrimary(mvff));
|
||||
MPS_ARGS_ADD(foArgs, FailoverSecondary, MVFFFreeSecondary(mvff));
|
||||
res = LandInit(MVFFFreeLand(mvff), CLASS(FailoverLandClass), arena, align,
|
||||
res = LandInit(MVFFFreeLand(mvff), CLASS(FailoverLand), arena, align,
|
||||
mvff, foArgs);
|
||||
} MPS_ARGS_END(foArgs);
|
||||
if (res != ResOK)
|
||||
|
|
@ -704,9 +704,9 @@ static Res MVFFDescribe(Pool pool, mps_lib_FILE *stream, Count depth)
|
|||
}
|
||||
|
||||
|
||||
DEFINE_POOL_CLASS(MVFFPoolClass, this)
|
||||
DEFINE_POOL_CLASS(MVFFPool, this)
|
||||
{
|
||||
INHERIT_CLASS(this, MVFFPoolClass, AbstractPoolClass);
|
||||
INHERIT_CLASS(this, MVFFPool, AbstractPool);
|
||||
PoolClassMixInBuffer(this);
|
||||
this->size = sizeof(MVFFStruct);
|
||||
this->varargs = MVFFVarargs;
|
||||
|
|
@ -725,15 +725,15 @@ DEFINE_POOL_CLASS(MVFFPoolClass, this)
|
|||
|
||||
PoolClass PoolClassMVFF(void)
|
||||
{
|
||||
return CLASS(MVFFPoolClass);
|
||||
return CLASS(MVFFPool);
|
||||
}
|
||||
|
||||
|
||||
/* Pool class MVFFDebug */
|
||||
|
||||
DEFINE_POOL_CLASS(MVFFDebugPoolClass, this)
|
||||
DEFINE_POOL_CLASS(MVFFDebugPool, this)
|
||||
{
|
||||
INHERIT_CLASS(this, MVFFDebugPoolClass, MVFFPoolClass);
|
||||
INHERIT_CLASS(this, MVFFDebugPool, MVFFPool);
|
||||
PoolClassMixInDebug(this);
|
||||
this->size = sizeof(MVFFDebugStruct);
|
||||
this->varargs = MVFFDebugVarargs;
|
||||
|
|
@ -747,12 +747,12 @@ DEFINE_POOL_CLASS(MVFFDebugPoolClass, this)
|
|||
|
||||
mps_pool_class_t mps_class_mvff(void)
|
||||
{
|
||||
return (mps_pool_class_t)(CLASS(MVFFPoolClass));
|
||||
return (mps_pool_class_t)(CLASS(MVFFPool));
|
||||
}
|
||||
|
||||
mps_pool_class_t mps_class_mvff_debug(void)
|
||||
{
|
||||
return (mps_pool_class_t)(CLASS(MVFFDebugPoolClass));
|
||||
return (mps_pool_class_t)(CLASS(MVFFDebugPool));
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -763,7 +763,7 @@ static Bool MVFFCheck(MVFF mvff)
|
|||
{
|
||||
CHECKS(MVFF, mvff);
|
||||
CHECKD(Pool, MVFFPool(mvff));
|
||||
CHECKL(IsSubclassPoly(MVFFPool(mvff)->class, CLASS(MVFFPoolClass)));
|
||||
CHECKL(IsSubclassPoly(MVFFPool(mvff)->class, CLASS(MVFFPool)));
|
||||
CHECKD(LocusPref, MVFFLocusPref(mvff));
|
||||
CHECKL(mvff->extendBy >= ArenaGrainSize(PoolArena(MVFFPool(mvff))));
|
||||
CHECKL(mvff->avgSize > 0); /* see .arg.check */
|
||||
|
|
|
|||
|
|
@ -261,9 +261,9 @@ static void NTraceEnd(Pool pool, Trace trace)
|
|||
|
||||
/* NPoolClass -- pool class definition for N */
|
||||
|
||||
DEFINE_POOL_CLASS(NPoolClass, this)
|
||||
DEFINE_POOL_CLASS(NPool, this)
|
||||
{
|
||||
INHERIT_CLASS(this, NPoolClass, AbstractPoolClass);
|
||||
INHERIT_CLASS(this, NPool, AbstractPool);
|
||||
this->size = sizeof(PoolNStruct);
|
||||
this->attr |= AttrGC;
|
||||
this->init = NInit;
|
||||
|
|
@ -289,7 +289,7 @@ DEFINE_POOL_CLASS(NPoolClass, this)
|
|||
|
||||
PoolClass PoolClassN(void)
|
||||
{
|
||||
return CLASS(NPoolClass);
|
||||
return CLASS(NPool);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -299,7 +299,7 @@ Bool PoolNCheck(PoolN poolN)
|
|||
{
|
||||
CHECKL(poolN != NULL);
|
||||
CHECKD(Pool, PoolNPool(poolN));
|
||||
CHECKL(PoolNPool(poolN)->class == CLASS(NPoolClass));
|
||||
CHECKL(PoolNPool(poolN)->class == CLASS(NPool));
|
||||
UNUSED(poolN); /* <code/mpm.c#check.unused> */
|
||||
|
||||
return TRUE;
|
||||
|
|
|
|||
|
|
@ -43,8 +43,8 @@ typedef struct SNCStruct {
|
|||
|
||||
/* Forward declarations */
|
||||
|
||||
DECLARE_CLASS(SegClass, SNCSegClass);
|
||||
DECLARE_CLASS(BufferClass, SNCBufClass);
|
||||
DECLARE_CLASS(Seg, SNCSeg);
|
||||
DECLARE_CLASS(Buffer, SNCBuf);
|
||||
static Bool SNCCheck(SNC snc);
|
||||
static void sncPopPartialSegChain(SNC snc, Buffer buf, Seg upTo);
|
||||
|
||||
|
|
@ -134,7 +134,7 @@ static Res SNCBufInit(Buffer buffer, Pool pool, ArgList args)
|
|||
AVERT(Pool, pool);
|
||||
|
||||
/* call next method */
|
||||
superclass = BUFFER_SUPERCLASS(SNCBufClass);
|
||||
superclass = BUFFER_SUPERCLASS(SNCBuf);
|
||||
res = (*superclass->init)(buffer, pool, args);
|
||||
if (res != ResOK)
|
||||
return res;
|
||||
|
|
@ -169,16 +169,16 @@ static void SNCBufFinish(Buffer buffer)
|
|||
sncbuf->sig = SigInvalid;
|
||||
|
||||
/* finish the superclass fields last */
|
||||
super = BUFFER_SUPERCLASS(SNCBufClass);
|
||||
super = BUFFER_SUPERCLASS(SNCBuf);
|
||||
super->finish(buffer);
|
||||
}
|
||||
|
||||
|
||||
/* SNCBufClass -- The class definition */
|
||||
|
||||
DEFINE_BUFFER_CLASS(SNCBufClass, class)
|
||||
DEFINE_BUFFER_CLASS(SNCBuf, class)
|
||||
{
|
||||
INHERIT_CLASS(class, SNCBufClass, RankBufClass);
|
||||
INHERIT_CLASS(class, SNCBuf, RankBuf);
|
||||
class->size = sizeof(SNCBufStruct);
|
||||
class->init = SNCBufInit;
|
||||
class->finish = SNCBufFinish;
|
||||
|
|
@ -237,7 +237,7 @@ static Res sncSegInit(Seg seg, Pool pool, Addr base, Size size, ArgList args)
|
|||
/* no useful checks for base and size */
|
||||
|
||||
/* Initialize the superclass fields first via next-method call */
|
||||
super = SEG_SUPERCLASS(SNCSegClass);
|
||||
super = SEG_SUPERCLASS(SNCSeg);
|
||||
res = super->init(seg, pool, base, size, args);
|
||||
if (res != ResOK)
|
||||
return res;
|
||||
|
|
@ -251,9 +251,9 @@ static Res sncSegInit(Seg seg, Pool pool, Addr base, Size size, ArgList args)
|
|||
|
||||
/* SNCSegClass -- Class definition for SNC segments */
|
||||
|
||||
DEFINE_SEG_CLASS(SNCSegClass, class)
|
||||
DEFINE_SEG_CLASS(SNCSeg, class)
|
||||
{
|
||||
INHERIT_CLASS(class, SNCSegClass, GCSegClass);
|
||||
INHERIT_CLASS(class, SNCSeg, GCSeg);
|
||||
SegClassMixInNoSplitMerge(class); /* no support for this (yet) */
|
||||
class->size = sizeof(SNCSegStruct);
|
||||
class->init = sncSegInit;
|
||||
|
|
@ -441,7 +441,7 @@ static Res SNCBufferFill(Addr *baseReturn, Addr *limitReturn,
|
|||
/* No free seg, so create a new one */
|
||||
arena = PoolArena(pool);
|
||||
asize = SizeArenaGrains(size, arena);
|
||||
res = SegAlloc(&seg, CLASS(SNCSegClass), LocusPrefDefault(),
|
||||
res = SegAlloc(&seg, CLASS(SNCSeg), LocusPrefDefault(),
|
||||
asize, pool, argsNone);
|
||||
if (res != ResOK)
|
||||
return res;
|
||||
|
|
@ -704,9 +704,9 @@ static Size SNCFreeSize(Pool pool)
|
|||
|
||||
/* SNCPoolClass -- the class definition */
|
||||
|
||||
DEFINE_POOL_CLASS(SNCPoolClass, this)
|
||||
DEFINE_POOL_CLASS(SNCPool, this)
|
||||
{
|
||||
INHERIT_CLASS(this, SNCPoolClass, AbstractScanPoolClass);
|
||||
INHERIT_CLASS(this, SNCPool, AbstractScanPool);
|
||||
PoolClassMixInFormat(this);
|
||||
this->size = sizeof(SNCStruct);
|
||||
this->varargs = SNCVarargs;
|
||||
|
|
@ -728,7 +728,7 @@ DEFINE_POOL_CLASS(SNCPoolClass, this)
|
|||
|
||||
mps_pool_class_t mps_class_snc(void)
|
||||
{
|
||||
return (mps_pool_class_t)CLASS(SNCPoolClass);
|
||||
return (mps_pool_class_t)CLASS(SNCPool);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -739,7 +739,7 @@ static Bool SNCCheck(SNC snc)
|
|||
{
|
||||
CHECKS(SNC, snc);
|
||||
CHECKD(Pool, SNCPool(snc));
|
||||
CHECKL(SNCPool(snc)->class == CLASS(SNCPoolClass));
|
||||
CHECKL(SNCPool(snc)->class == CLASS(SNCPool));
|
||||
if (snc->freeSegs != NULL) {
|
||||
CHECKD(Seg, snc->freeSegs);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,12 +53,12 @@ Bool ProtocolIsSubclass(InstClass sub, InstClass super)
|
|||
|
||||
/* The class definition for the root of the hierarchy */
|
||||
|
||||
DEFINE_CLASS(InstClass, theClass)
|
||||
DEFINE_CLASS(Inst, theClass)
|
||||
{
|
||||
theClass->sig = InstClassSig;
|
||||
theClass->name = "Inst";
|
||||
theClass->superclass = theClass;
|
||||
theClass->typeId = ProtocolPrime[InstClassIndexProtocolClass];
|
||||
theClass->typeId = ProtocolPrime[ProtocolClassIndexInst];
|
||||
AVERT(InstClass, theClass);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -14,74 +14,77 @@
|
|||
#include "classdef.h"
|
||||
|
||||
|
||||
/* DERIVE_* -- name derivation macros.
|
||||
/* CLASS_* -- identifier derivation macros.
|
||||
*
|
||||
* These turn the base identifier of a class into other identifiers.
|
||||
* These are not intended to be used outside of this file.
|
||||
* These turn the base identifier of a class (e.g. "Inst") into other
|
||||
* identifiers (e.g. "InstClassStruct"). These are not intended to be
|
||||
* used outside of this file.
|
||||
*/
|
||||
|
||||
#define DERIVE_LOCAL(name) protocol ## name
|
||||
#define DERIVE_STRUCT(name) name ## Struct
|
||||
#define DERIVE_ENSURE(name) name ## Get
|
||||
#define DERIVE_INIT(name) name ## Init
|
||||
#define DERIVE_GUARDIAN(name) protocol ## name ## Guardian
|
||||
#define DERIVE_STATIC_STORAGE(name) protocol ## name ## Struct
|
||||
#define INST_TYPE(ident) ident
|
||||
#define INST_STRUCT(ident) ident ## Struct
|
||||
#define CLASS_TYPE(ident) ident ## Class
|
||||
#define CLASS_STRUCT(ident) ident ## ClassStruct
|
||||
#define CLASS_ENSURE(ident) ident ## ClassGet
|
||||
#define CLASS_INIT(ident) ident ## ClassInit
|
||||
#define CLASS_GUARDIAN(ident) ident ## ClassGuardian
|
||||
#define CLASS_STATIC(ident) static ## ident ## ClassStruct
|
||||
|
||||
|
||||
/* DECLARE_CLASS -- declare the existence of a protocol class */
|
||||
|
||||
#define DECLARE_CLASS(classKind, className) \
|
||||
extern classKind DERIVE_ENSURE(className)(void); \
|
||||
extern void DERIVE_INIT(className)(classKind var)
|
||||
#define DECLARE_CLASS(kind, ident) \
|
||||
extern CLASS_TYPE(kind) CLASS_ENSURE(ident)(void); \
|
||||
extern void CLASS_INIT(ident)(CLASS_TYPE(kind) var)
|
||||
|
||||
|
||||
/* DEFINE_CLASS -- the standard macro for defining a InstClass */
|
||||
|
||||
#define DEFINE_CLASS(className, var) \
|
||||
DECLARE_CLASS(className, className); \
|
||||
static Bool DERIVE_GUARDIAN(className) = FALSE; \
|
||||
static DERIVE_STRUCT(className) DERIVE_STATIC_STORAGE(className); \
|
||||
void DERIVE_INIT(className)(className); \
|
||||
className DERIVE_ENSURE(className)(void) \
|
||||
#define DEFINE_CLASS(ident, var) \
|
||||
DECLARE_CLASS(ident, ident); \
|
||||
void CLASS_INIT(ident)(CLASS_TYPE(ident)); \
|
||||
CLASS_TYPE(ident) CLASS_ENSURE(ident)(void) \
|
||||
{ \
|
||||
if (DERIVE_GUARDIAN(className) == FALSE) { \
|
||||
static Bool CLASS_GUARDIAN(ident) = FALSE; \
|
||||
static CLASS_STRUCT(ident) CLASS_STATIC(ident); \
|
||||
if (CLASS_GUARDIAN(ident) == FALSE) { \
|
||||
LockClaimGlobalRecursive(); \
|
||||
if (DERIVE_GUARDIAN(className) == FALSE) { \
|
||||
DERIVE_INIT(className) \
|
||||
(&DERIVE_STATIC_STORAGE(className)); \
|
||||
DERIVE_GUARDIAN(className) = TRUE; \
|
||||
if (CLASS_GUARDIAN(ident) == FALSE) { \
|
||||
CLASS_INIT(ident) \
|
||||
(&CLASS_STATIC(ident)); \
|
||||
CLASS_GUARDIAN(ident) = TRUE; \
|
||||
} \
|
||||
LockReleaseGlobalRecursive(); \
|
||||
} \
|
||||
return &DERIVE_STATIC_STORAGE(className); \
|
||||
return &CLASS_STATIC(ident); \
|
||||
} \
|
||||
void DERIVE_INIT(className)(className var)
|
||||
void CLASS_INIT(ident)(CLASS_TYPE(ident) var)
|
||||
|
||||
|
||||
/* CLASS -- expression for getting a class */
|
||||
|
||||
#define CLASS(className) (DERIVE_ENSURE(className)())
|
||||
#define CLASS(ident) (CLASS_ENSURE(ident)())
|
||||
|
||||
|
||||
/* INHERIT_CLASS -- the standard macro for inheriting from a superclass */
|
||||
|
||||
extern unsigned ProtocolPrime[1000];
|
||||
|
||||
#define CLASS_INDEX_ENUM(prefix, ident, kind, super) prefix ## ident ## Class,
|
||||
typedef enum InstClassIndexEnum {
|
||||
InstClassIndexInvalid, /* index zero (prime 2) reserved for invalid classes */
|
||||
CLASSES(CLASS_INDEX_ENUM, InstClassIndex)
|
||||
InstClassIndexLIMIT
|
||||
} InstClassIndexEnum;
|
||||
#define CLASS_INDEX_ENUM(prefix, ident, kind, super) prefix ## ident,
|
||||
typedef enum ProtocolClassIndexEnum {
|
||||
ProtocolClassIndexInvalid, /* index zero (prime 2) reserved for invalid classes */
|
||||
CLASSES(CLASS_INDEX_ENUM, ProtocolClassIndex)
|
||||
ProtocolClassIndexLIMIT
|
||||
} ProtocolClassIndexEnum;
|
||||
|
||||
#define INHERIT_CLASS(this, _class, super) \
|
||||
BEGIN \
|
||||
InstClass protocolClass = (InstClass)(this); \
|
||||
DERIVE_INIT(super)(this); \
|
||||
CLASS_INIT(super)(this); \
|
||||
protocolClass->superclass = (InstClass)CLASS(super); \
|
||||
protocolClass->name = #_class; \
|
||||
protocolClass->typeId = \
|
||||
ProtocolPrime[InstClassIndex ## _class] * \
|
||||
ProtocolPrime[ProtocolClassIndex ## _class] * \
|
||||
protocolClass->superclass->typeId; \
|
||||
END
|
||||
|
||||
|
|
@ -92,11 +95,10 @@ typedef enum InstClassIndexEnum {
|
|||
* for className to be the same as typeName, and then defines
|
||||
* the class className.
|
||||
*/
|
||||
#define DEFINE_ALIAS_CLASS(className, typeName, var) \
|
||||
typedef typeName className; \
|
||||
typedef DERIVE_STRUCT(typeName) DERIVE_STRUCT(className); \
|
||||
DEFINE_CLASS(className, var)
|
||||
|
||||
#define DEFINE_ALIAS_CLASS(ident, other, var) \
|
||||
typedef CLASS_TYPE(other) CLASS_TYPE(ident); \
|
||||
typedef CLASS_STRUCT(other) CLASS_STRUCT(ident); \
|
||||
DEFINE_CLASS(ident, var)
|
||||
|
||||
|
||||
#define InstClassSig ((Sig)0x519B60C7) /* SIGnature PROtocol CLass */
|
||||
|
|
@ -129,7 +131,7 @@ typedef struct InstClassStruct {
|
|||
|
||||
/* InstClass -- the root of the protocol class hierarchy */
|
||||
|
||||
DECLARE_CLASS(InstClass, InstClass);
|
||||
DECLARE_CLASS(Inst, Inst);
|
||||
|
||||
|
||||
/* Checking functions */
|
||||
|
|
@ -170,7 +172,7 @@ extern Bool ProtocolIsSubclass(InstClass sub, InstClass super);
|
|||
* <design/protocol/#int.static-superclass>
|
||||
*/
|
||||
#define SUPERCLASS(className) \
|
||||
InstClassSuperclassPoly(DERIVE_ENSURE(className)())
|
||||
InstClassSuperclassPoly(CLASS_ENSURE(className)())
|
||||
|
||||
|
||||
#endif /* protocol_h */
|
||||
|
|
|
|||
|
|
@ -1095,7 +1095,7 @@ static Res gcSegInit(Seg seg, Pool pool, Addr base, Size size, ArgList args)
|
|||
AVER(&gcseg->segStruct == seg);
|
||||
|
||||
/* Initialize the superclass fields first via next-method call */
|
||||
super = SEG_SUPERCLASS(GCSegClass);
|
||||
super = SEG_SUPERCLASS(GCSeg);
|
||||
res = super->init(seg, pool, base, size, args);
|
||||
if (ResOK != res)
|
||||
return res;
|
||||
|
|
@ -1136,7 +1136,7 @@ static void gcSegFinish(Seg seg)
|
|||
RingFinish(&gcseg->greyRing);
|
||||
|
||||
/* finish the superclass fields last */
|
||||
super = SEG_SUPERCLASS(GCSegClass);
|
||||
super = SEG_SUPERCLASS(GCSeg);
|
||||
super->finish(seg);
|
||||
}
|
||||
|
||||
|
|
@ -1473,7 +1473,7 @@ static Res gcSegMerge(Seg seg, Seg segHi,
|
|||
}
|
||||
|
||||
/* Merge the superclass fields via next-method call */
|
||||
super = SEG_SUPERCLASS(GCSegClass);
|
||||
super = SEG_SUPERCLASS(GCSeg);
|
||||
res = super->merge(seg, segHi, base, mid, limit);
|
||||
if (res != ResOK)
|
||||
goto failSuper;
|
||||
|
|
@ -1535,7 +1535,7 @@ static Res gcSegSplit(Seg seg, Seg segHi,
|
|||
}
|
||||
|
||||
/* Split the superclass fields via next-method call */
|
||||
super = SEG_SUPERCLASS(GCSegClass);
|
||||
super = SEG_SUPERCLASS(GCSeg);
|
||||
res = super->split(seg, segHi, base, mid, limit);
|
||||
if (res != ResOK)
|
||||
goto failSuper;
|
||||
|
|
@ -1581,7 +1581,7 @@ static Res gcSegDescribe(Seg seg, mps_lib_FILE *stream, Count depth)
|
|||
return ResFAIL;
|
||||
|
||||
/* Describe the superclass fields first via next-method call */
|
||||
super = SEG_SUPERCLASS(GCSegClass);
|
||||
super = SEG_SUPERCLASS(GCSeg);
|
||||
res = super->describe(seg, stream, depth);
|
||||
if (res != ResOK)
|
||||
return res;
|
||||
|
|
@ -1626,9 +1626,9 @@ Bool SegClassCheck(SegClass class)
|
|||
|
||||
/* SegClass -- the vanilla segment class definition */
|
||||
|
||||
DEFINE_CLASS(SegClass, class)
|
||||
DEFINE_CLASS(Seg, class)
|
||||
{
|
||||
INHERIT_CLASS(&class->protocol, SegClass, InstClass);
|
||||
INHERIT_CLASS(&class->protocol, Seg, Inst);
|
||||
class->size = sizeof(SegStruct);
|
||||
class->init = segTrivInit;
|
||||
class->finish = segTrivFinish;
|
||||
|
|
@ -1651,9 +1651,9 @@ DEFINE_CLASS(SegClass, class)
|
|||
|
||||
typedef SegClassStruct GCSegClassStruct;
|
||||
|
||||
DEFINE_CLASS(GCSegClass, class)
|
||||
DEFINE_CLASS(GCSeg, class)
|
||||
{
|
||||
INHERIT_CLASS(class, GCSegClass, SegClass);
|
||||
INHERIT_CLASS(class, GCSeg, Seg);
|
||||
class->size = sizeof(GCSegStruct);
|
||||
class->init = gcSegInit;
|
||||
class->finish = gcSegFinish;
|
||||
|
|
|
|||
|
|
@ -28,8 +28,8 @@
|
|||
|
||||
/* Forward declarations */
|
||||
|
||||
DECLARE_CLASS(SegClass, AMSTSegClass);
|
||||
DECLARE_CLASS(PoolClass, AMSTPoolClass);
|
||||
DECLARE_CLASS(Seg, AMSTSeg);
|
||||
DECLARE_CLASS(Pool, AMSTPool);
|
||||
|
||||
|
||||
/* Start by defining the AMST pool (AMS Test pool) */
|
||||
|
|
@ -126,7 +126,7 @@ static Res amstSegInit(Seg seg, Pool pool, Addr base, Size size, ArgList args)
|
|||
/* no useful checks for base and size */
|
||||
|
||||
/* Initialize the superclass fields first via next-method call */
|
||||
super = SEG_SUPERCLASS(AMSTSegClass);
|
||||
super = SEG_SUPERCLASS(AMSTSeg);
|
||||
res = super->init(seg, pool, base, size, args);
|
||||
if (res != ResOK)
|
||||
return res;
|
||||
|
|
@ -158,7 +158,7 @@ static void amstSegFinish(Seg seg)
|
|||
|
||||
amstseg->sig = SigInvalid;
|
||||
/* finish the superclass fields last */
|
||||
super = SEG_SUPERCLASS(AMSTSegClass);
|
||||
super = SEG_SUPERCLASS(AMSTSeg);
|
||||
super->finish(seg);
|
||||
}
|
||||
|
||||
|
|
@ -190,7 +190,7 @@ static Res amstSegMerge(Seg seg, Seg segHi,
|
|||
amst = PoolAMST(SegPool(seg));
|
||||
|
||||
/* Merge the superclass fields via direct next-method call */
|
||||
super = SEG_SUPERCLASS(AMSTSegClass);
|
||||
super = SEG_SUPERCLASS(AMSTSeg);
|
||||
res = super->merge(seg, segHi, base, mid, limit);
|
||||
if (res != ResOK)
|
||||
goto failSuper;
|
||||
|
|
@ -238,7 +238,7 @@ static Res amstSegSplit(Seg seg, Seg segHi,
|
|||
amst = PoolAMST(SegPool(seg));
|
||||
|
||||
/* Split the superclass fields via direct next-method call */
|
||||
super = SEG_SUPERCLASS(AMSTSegClass);
|
||||
super = SEG_SUPERCLASS(AMSTSeg);
|
||||
res = super->split(seg, segHi, base, mid, limit);
|
||||
if (res != ResOK)
|
||||
goto failSuper;
|
||||
|
|
@ -273,9 +273,9 @@ failSuper:
|
|||
|
||||
/* AMSTSegClass -- Class definition for AMST segments */
|
||||
|
||||
DEFINE_SEG_CLASS(AMSTSegClass, class)
|
||||
DEFINE_SEG_CLASS(AMSTSeg, class)
|
||||
{
|
||||
INHERIT_CLASS(class, AMSTSegClass, AMSSegClass);
|
||||
INHERIT_CLASS(class, AMSTSeg, AMSSeg);
|
||||
class->size = sizeof(AMSTSegStruct);
|
||||
class->init = amstSegInit;
|
||||
class->finish = amstSegFinish;
|
||||
|
|
@ -538,7 +538,7 @@ static Res AMSTBufferFill(Addr *baseReturn, Addr *limitReturn,
|
|||
amst = PoolAMST(pool);
|
||||
|
||||
/* call next method */
|
||||
super = POOL_SUPERCLASS(AMSTPoolClass);
|
||||
super = POOL_SUPERCLASS(AMSTPool);
|
||||
res = super->bufferFill(&base, &limit, pool, buffer, size);
|
||||
if (res != ResOK)
|
||||
return res;
|
||||
|
|
@ -662,9 +662,9 @@ static void AMSTStressBufferedSeg(Seg seg, Buffer buffer)
|
|||
|
||||
/* AMSTPoolClass -- the pool class definition */
|
||||
|
||||
DEFINE_POOL_CLASS(AMSTPoolClass, this)
|
||||
DEFINE_POOL_CLASS(AMSTPool, this)
|
||||
{
|
||||
INHERIT_CLASS(this, AMSTPoolClass, AMSPoolClass);
|
||||
INHERIT_CLASS(this, AMSTPool, AMSPool);
|
||||
this->size = sizeof(AMSTStruct);
|
||||
this->init = AMSTInit;
|
||||
this->finish = AMSTFinish;
|
||||
|
|
@ -693,7 +693,7 @@ static void mps_amst_ap_stress(mps_ap_t ap)
|
|||
|
||||
static mps_pool_class_t mps_class_amst(void)
|
||||
{
|
||||
return (mps_pool_class_t)CLASS(AMSTPoolClass);
|
||||
return (mps_pool_class_t)CLASS(AMSTPool);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -723,7 +723,7 @@ void ArenaExposeRemember(Globals globals, Bool remember)
|
|||
|
||||
do {
|
||||
base = SegBase(seg);
|
||||
if (IsSubclassPoly(ClassOfSeg(seg), CLASS(GCSegClass))) {
|
||||
if (IsSubclassPoly(ClassOfSeg(seg), CLASS(GCSeg))) {
|
||||
if(remember) {
|
||||
RefSet summary;
|
||||
|
||||
|
|
@ -766,7 +766,7 @@ void ArenaRestoreProtection(Globals globals)
|
|||
}
|
||||
b = SegOfAddr(&seg, arena, block->the[i].base);
|
||||
if(b && SegBase(seg) == block->the[i].base) {
|
||||
AVER(IsSubclassPoly(ClassOfSeg(seg), CLASS(GCSegClass)));
|
||||
AVER(IsSubclassPoly(ClassOfSeg(seg), CLASS(GCSeg)));
|
||||
SegSetSummary(seg, block->the[i].summary);
|
||||
} else {
|
||||
/* Either seg has gone or moved, both of which are */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue