mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-27 07:41:28 -08:00
Merge branch/2014-02-26/args-done into master sources.
Copied from Perforce Change: 184554 ServerID: perforce.ravenbrook.com
This commit is contained in:
commit
f419a2ede9
37 changed files with 16 additions and 86 deletions
|
|
@ -226,7 +226,6 @@ int main(int argc, char *argv[])
|
|||
MPS_ARGS_ADD(args, MPS_KEY_FORMAT, format);
|
||||
MPS_ARGS_ADD(args, MPS_KEY_AMS_SUPPORT_AMBIGUOUS, FALSE);
|
||||
MPS_ARGS_ADD(args, MPS_KEY_POOL_DEBUG_OPTIONS, &freecheckOptions);
|
||||
MPS_ARGS_DONE(args);
|
||||
die(mps_pool_create_k(&pool, arena, mps_class_ams_debug(), args),
|
||||
"pool_create(ams_debug,share)");
|
||||
} MPS_ARGS_END(args);
|
||||
|
|
@ -239,7 +238,6 @@ int main(int argc, char *argv[])
|
|||
MPS_ARGS_ADD(args, MPS_KEY_FORMAT, format);
|
||||
MPS_ARGS_ADD(args, MPS_KEY_AMS_SUPPORT_AMBIGUOUS, TRUE);
|
||||
MPS_ARGS_ADD(args, MPS_KEY_POOL_DEBUG_OPTIONS, &freecheckOptions);
|
||||
MPS_ARGS_DONE(args);
|
||||
die(mps_pool_create_k(&pool, arena, mps_class_ams_debug(), args),
|
||||
"pool_create(ams_debug,ambig)");
|
||||
} MPS_ARGS_END(args);
|
||||
|
|
@ -252,7 +250,6 @@ int main(int argc, char *argv[])
|
|||
MPS_ARGS_ADD(args, MPS_KEY_FORMAT, format);
|
||||
MPS_ARGS_ADD(args, MPS_KEY_AMS_SUPPORT_AMBIGUOUS, TRUE);
|
||||
MPS_ARGS_ADD(args, MPS_KEY_POOL_DEBUG_OPTIONS, &freecheckOptions);
|
||||
MPS_ARGS_DONE(args);
|
||||
die(mps_pool_create_k(&pool, arena, mps_class_ams(), args),
|
||||
"pool_create(ams,ambig)");
|
||||
} MPS_ARGS_END(args);
|
||||
|
|
@ -265,7 +262,6 @@ int main(int argc, char *argv[])
|
|||
MPS_ARGS_ADD(args, MPS_KEY_FORMAT, format);
|
||||
MPS_ARGS_ADD(args, MPS_KEY_AMS_SUPPORT_AMBIGUOUS, FALSE);
|
||||
MPS_ARGS_ADD(args, MPS_KEY_POOL_DEBUG_OPTIONS, &freecheckOptions);
|
||||
MPS_ARGS_DONE(args);
|
||||
die(mps_pool_create_k(&pool, arena, mps_class_ams(), args),
|
||||
"pool_create(ams,share)");
|
||||
} MPS_ARGS_END(args);
|
||||
|
|
|
|||
|
|
@ -314,7 +314,6 @@ Res ControlInit(Arena arena)
|
|||
AVERT(Arena, arena);
|
||||
MPS_ARGS_BEGIN(args) {
|
||||
MPS_ARGS_ADD(args, MPS_KEY_EXTEND_BY, CONTROL_EXTEND_BY);
|
||||
MPS_ARGS_DONE(args);
|
||||
res = PoolInit(&arena->controlPoolStruct.poolStruct, arena,
|
||||
PoolClassMV(), args);
|
||||
} MPS_ARGS_END(args);
|
||||
|
|
|
|||
|
|
@ -344,7 +344,6 @@ static void testPageTable(ArenaClass class, Size size, Addr addr)
|
|||
MPS_ARGS_BEGIN(args) {
|
||||
MPS_ARGS_ADD(args, MPS_KEY_ARENA_SIZE, size);
|
||||
MPS_ARGS_ADD(args, MPS_KEY_ARENA_CL_BASE, addr);
|
||||
MPS_ARGS_DONE(args);
|
||||
die(ArenaCreate(&arena, class, args), "ArenaCreate");
|
||||
} MPS_ARGS_END(args);
|
||||
|
||||
|
|
@ -382,7 +381,6 @@ static void testSize(Size size)
|
|||
do {
|
||||
MPS_ARGS_BEGIN(args) {
|
||||
MPS_ARGS_ADD(args, MPS_KEY_ARENA_SIZE, size);
|
||||
MPS_ARGS_DONE(args);
|
||||
res = ArenaCreate(&arena, class, args);
|
||||
} MPS_ARGS_END(args);
|
||||
if (res == ResOK)
|
||||
|
|
|
|||
|
|
@ -278,7 +278,6 @@ static void *setup(void *v, size_t s)
|
|||
weaknesss and want things to die in it promptly. */
|
||||
MPS_ARGS_ADD(args, MPS_KEY_GEN, 0);
|
||||
MPS_ARGS_ADD(args, MPS_KEY_FORMAT, dylanfmt);
|
||||
MPS_ARGS_DONE(args);
|
||||
die(mps_pool_create_k(&leafpool, arena, mps_class_lo(), args),
|
||||
"Leaf Pool Create\n");
|
||||
} MPS_ARGS_END(args);
|
||||
|
|
|
|||
|
|
@ -281,7 +281,6 @@ static void *setup(void *v, size_t s)
|
|||
weaknesss and want things to die in it promptly. */
|
||||
MPS_ARGS_ADD(args, MPS_KEY_GEN, 0);
|
||||
MPS_ARGS_ADD(args, MPS_KEY_FORMAT, dylanfmt);
|
||||
MPS_ARGS_DONE(args);
|
||||
die(mps_pool_create_k(&leafpool, arena, mps_class_lo(), args),
|
||||
"Leaf Pool Create\n");
|
||||
} MPS_ARGS_END(args);
|
||||
|
|
|
|||
|
|
@ -223,7 +223,6 @@ Res CBSInit(Arena arena, CBS cbs, void *owner, Align alignment,
|
|||
MPS_ARGS_BEGIN(pcArgs) {
|
||||
MPS_ARGS_ADD(pcArgs, MPS_KEY_MFS_UNIT_SIZE, sizeof(CBSBlockStruct));
|
||||
MPS_ARGS_ADD(pcArgs, MPS_KEY_EXTEND_BY, extendBy);
|
||||
MPS_ARGS_DONE(pcArgs);
|
||||
res = PoolCreate(&(cbs->blockPool), arena, PoolClassMFS(), pcArgs);
|
||||
} MPS_ARGS_END(pcArgs);
|
||||
if (res != ResOK)
|
||||
|
|
|
|||
|
|
@ -188,7 +188,6 @@ static Res DebugPoolInit(Pool pool, ArgList args)
|
|||
MPS_ARGS_BEGIN(pcArgs) {
|
||||
MPS_ARGS_ADD(pcArgs, MPS_KEY_EXTEND_BY, debug->tagSize); /* FIXME: Check this */
|
||||
MPS_ARGS_ADD(pcArgs, MPS_KEY_MFS_UNIT_SIZE, debug->tagSize);
|
||||
MPS_ARGS_DONE(pcArgs);
|
||||
res = PoolCreate(&debug->tagPool, PoolArena(pool), PoolClassMFS(), pcArgs);
|
||||
} MPS_ARGS_END(pcArgs);
|
||||
if (res != ResOK)
|
||||
|
|
|
|||
|
|
@ -187,7 +187,6 @@ static void arena_wrap(dj_t dj, mps_class_t pool_class, const char *name)
|
|||
{
|
||||
MPS_ARGS_BEGIN(args) {
|
||||
MPS_ARGS_ADD(args, MPS_KEY_ARENA_SIZE, 256ul * 1024 * 1024); /* FIXME: Why is there no default? */
|
||||
MPS_ARGS_DONE(args);
|
||||
DJMUST(mps_arena_create_k(&arena, mps_arena_class_vm(), args));
|
||||
} MPS_ARGS_END(args);
|
||||
DJMUST(mps_pool_create_k(&pool, arena, pool_class, mps_args_none));
|
||||
|
|
|
|||
|
|
@ -183,7 +183,6 @@ int main(int argc, char *argv[])
|
|||
MPS_ARGS_ADD(args, MPS_KEY_MVFF_ARENA_HIGH, rnd() % 2);
|
||||
MPS_ARGS_ADD(args, MPS_KEY_MVFF_SLOT_HIGH, rnd() % 2);
|
||||
MPS_ARGS_ADD(args, MPS_KEY_MVFF_FIRST_FIT, rnd() % 2);
|
||||
MPS_ARGS_DONE(args);
|
||||
die(mps_pool_create_k(&pool, arena, mps_class_mvff(), args), "create MVFF");
|
||||
} MPS_ARGS_END(args);
|
||||
{
|
||||
|
|
@ -203,7 +202,6 @@ int main(int argc, char *argv[])
|
|||
MPS_ARGS_ADD(args, MPS_KEY_MAX_SIZE, (1 + rnd() % 4) * 1024);
|
||||
MPS_ARGS_ADD(args, MPS_KEY_MVT_RESERVE_DEPTH, (1 + rnd() % 64) * 16);
|
||||
MPS_ARGS_ADD(args, MPS_KEY_MVT_FRAG_LIMIT, (rnd() % 101) / 100.0);
|
||||
MPS_ARGS_DONE(args);
|
||||
die(mps_pool_create_k(&pool, arena, mps_class_mvt(), args), "create MVFF");
|
||||
} MPS_ARGS_END(args);
|
||||
{
|
||||
|
|
|
|||
|
|
@ -240,7 +240,6 @@ static void arena_setup(gcthread_fn_t fn,
|
|||
{
|
||||
MPS_ARGS_BEGIN(args) {
|
||||
MPS_ARGS_ADD(args, MPS_KEY_ARENA_SIZE, arenasize);
|
||||
MPS_ARGS_DONE(args);
|
||||
RESMUST(mps_arena_create_k(&arena, mps_arena_class_vm(), args));
|
||||
} MPS_ARGS_END(args);
|
||||
RESMUST(dylan_fmt(&format, arena));
|
||||
|
|
@ -253,7 +252,6 @@ static void arena_setup(gcthread_fn_t fn,
|
|||
MPS_ARGS_ADD(args, MPS_KEY_FORMAT, format);
|
||||
if (ngen > 0)
|
||||
MPS_ARGS_ADD(args, MPS_KEY_CHAIN, chain);
|
||||
MPS_ARGS_DONE(args);
|
||||
RESMUST(mps_pool_create_k(&pool, arena, pool_class, args));
|
||||
} MPS_ARGS_END(args);
|
||||
watch(fn, name);
|
||||
|
|
|
|||
|
|
@ -222,16 +222,18 @@ extern const struct mps_key_s _mps_key_fmt_class;
|
|||
|
||||
#define MPS_ARGS_BEGIN(_var) \
|
||||
MPS_BEGIN \
|
||||
mps_arg_s _var[MPS_ARGS_MAX]; \
|
||||
unsigned _var##_i = 0; \
|
||||
MPS_BEGIN
|
||||
mps_arg_s _var[MPS_ARGS_MAX]; \
|
||||
unsigned _var##_i = 0; \
|
||||
_var[_var##_i].key = MPS_KEY_ARGS_END; \
|
||||
MPS_BEGIN
|
||||
|
||||
#define MPS_ARGS_ADD_FIELD(_var, _key, _field, _val) \
|
||||
MPS_BEGIN \
|
||||
/* TODO: AVER(_var##_i < MPS_ARGS_MAX); */ \
|
||||
/* TODO: AVER(_var##_i + 1 < MPS_ARGS_MAX); */ \
|
||||
_var[_var##_i].key = (_key); \
|
||||
_var[_var##_i].val._field = (_val); \
|
||||
++_var##_i; \
|
||||
_var[_var##_i].key = MPS_KEY_ARGS_END; \
|
||||
MPS_END
|
||||
|
||||
#define MPS_ARGS_ADD(_var, _key, _val) \
|
||||
|
|
|
|||
|
|
@ -498,7 +498,6 @@ mps_res_t mps_fmt_create_A(mps_fmt_t *mps_fmt_o,
|
|||
MPS_ARGS_ADD(args, MPS_KEY_FMT_FWD, mps_fmt_A->fwd);
|
||||
MPS_ARGS_ADD(args, MPS_KEY_FMT_ISFWD, mps_fmt_A->isfwd);
|
||||
MPS_ARGS_ADD(args, MPS_KEY_FMT_PAD, mps_fmt_A->pad);
|
||||
MPS_ARGS_DONE(args);
|
||||
res = FormatCreate(&format, arena, args);
|
||||
} MPS_ARGS_END(args);
|
||||
|
||||
|
|
@ -533,7 +532,6 @@ mps_res_t mps_fmt_create_B(mps_fmt_t *mps_fmt_o,
|
|||
MPS_ARGS_ADD(args, MPS_KEY_FMT_ISFWD, mps_fmt_B->isfwd);
|
||||
MPS_ARGS_ADD(args, MPS_KEY_FMT_PAD, mps_fmt_B->pad);
|
||||
MPS_ARGS_ADD(args, MPS_KEY_FMT_CLASS, mps_fmt_B->mps_class);
|
||||
MPS_ARGS_DONE(args);
|
||||
res = FormatCreate(&format, arena, args);
|
||||
} MPS_ARGS_END(args);
|
||||
|
||||
|
|
@ -568,7 +566,6 @@ mps_res_t mps_fmt_create_auto_header(mps_fmt_t *mps_fmt_o,
|
|||
MPS_ARGS_ADD(args, MPS_KEY_FMT_FWD, mps_fmt->fwd);
|
||||
MPS_ARGS_ADD(args, MPS_KEY_FMT_ISFWD, mps_fmt->isfwd);
|
||||
MPS_ARGS_ADD(args, MPS_KEY_FMT_PAD, mps_fmt->pad);
|
||||
MPS_ARGS_DONE(args);
|
||||
res = FormatCreate(&format, arena, args);
|
||||
} MPS_ARGS_END(args);
|
||||
|
||||
|
|
@ -601,7 +598,6 @@ mps_res_t mps_fmt_create_fixed(mps_fmt_t *mps_fmt_o,
|
|||
MPS_ARGS_ADD(args, MPS_KEY_FMT_FWD, mps_fmt_fixed->fwd);
|
||||
MPS_ARGS_ADD(args, MPS_KEY_FMT_ISFWD, mps_fmt_fixed->isfwd);
|
||||
MPS_ARGS_ADD(args, MPS_KEY_FMT_PAD, mps_fmt_fixed->pad);
|
||||
MPS_ARGS_DONE(args);
|
||||
res = FormatCreate(&format, arena, args);
|
||||
} MPS_ARGS_END(args);
|
||||
|
||||
|
|
|
|||
|
|
@ -187,7 +187,6 @@ static void stress_with_arena_class(mps_arena_class_t aclass)
|
|||
MPS_ARGS_ADD(args, MPS_KEY_MAX_SIZE, max);
|
||||
MPS_ARGS_ADD(args, MPS_KEY_MVT_RESERVE_DEPTH, TEST_SET_SIZE/2);
|
||||
MPS_ARGS_ADD(args, MPS_KEY_MVT_FRAG_LIMIT, 0.3);
|
||||
MPS_ARGS_DONE(args);
|
||||
die(stress(mps_class_mvt(), arena, randomSize, args), "stress MVT");
|
||||
} MPS_ARGS_END(args);
|
||||
|
||||
|
|
|
|||
|
|
@ -1191,7 +1191,6 @@ static Res AMCBufferFill(Addr *baseReturn, Addr *limitReturn,
|
|||
alignedSize = SizeAlignUp(size, ArenaAlign(arena));
|
||||
MPS_ARGS_BEGIN(args) {
|
||||
MPS_ARGS_ADD_FIELD(args, amcKeySegType, p, &gen->type); /* .segtype */
|
||||
MPS_ARGS_DONE(args);
|
||||
res = ChainAlloc(&seg, amc->chain, PoolGenNr(pgen), amcSegClassGet(),
|
||||
alignedSize, pool, withReservoirPermit, args);
|
||||
} MPS_ARGS_END(args);
|
||||
|
|
|
|||
|
|
@ -467,7 +467,6 @@ static Res AWLSegCreate(AWLSeg *awlsegReturn,
|
|||
return ResMEMORY;
|
||||
MPS_ARGS_BEGIN(args) {
|
||||
MPS_ARGS_ADD_FIELD(args, awlKeySegRankSet, u, rankSet);
|
||||
MPS_ARGS_DONE(args);
|
||||
res = ChainAlloc(&seg, awl->chain, awl->pgen.nr, AWLSegClassGet(),
|
||||
size, pool, reservoirPermit, args);
|
||||
} MPS_ARGS_END(args);
|
||||
|
|
|
|||
|
|
@ -526,7 +526,6 @@ static Res MRGSegPairCreate(MRGRefSeg *refSegReturn, MRG mrg,
|
|||
|
||||
MPS_ARGS_BEGIN(args) {
|
||||
MPS_ARGS_ADD_FIELD(args, mrgKeyLinkSeg, p, linkseg); /* .ref.initarg */
|
||||
MPS_ARGS_DONE(args);
|
||||
res = SegAlloc(&segRefPart, EnsureMRGRefSegClass(),
|
||||
SegPrefDefault(), mrg->extendBy, pool,
|
||||
withReservoirPermit, args);
|
||||
|
|
|
|||
|
|
@ -243,7 +243,6 @@ static Res MVInit(Pool pool, ArgList args)
|
|||
MPS_ARGS_BEGIN(piArgs) {
|
||||
MPS_ARGS_ADD(piArgs, MPS_KEY_EXTEND_BY, blockExtendBy);
|
||||
MPS_ARGS_ADD(piArgs, MPS_KEY_MFS_UNIT_SIZE, sizeof(MVBlockStruct));
|
||||
MPS_ARGS_DONE(piArgs);
|
||||
res = PoolInit(&mv->blockPoolStruct.poolStruct, arena, PoolClassMFS(), piArgs);
|
||||
} MPS_ARGS_END(piArgs);
|
||||
if(res != ResOK)
|
||||
|
|
@ -254,7 +253,6 @@ static Res MVInit(Pool pool, ArgList args)
|
|||
MPS_ARGS_BEGIN(piArgs) {
|
||||
MPS_ARGS_ADD(piArgs, MPS_KEY_EXTEND_BY, spanExtendBy);
|
||||
MPS_ARGS_ADD(piArgs, MPS_KEY_MFS_UNIT_SIZE, sizeof(MVSpanStruct));
|
||||
MPS_ARGS_DONE(piArgs);
|
||||
res = PoolInit(&mv->spanPoolStruct.poolStruct, arena, PoolClassMFS(), piArgs);
|
||||
} MPS_ARGS_END(piArgs);
|
||||
if(res != ResOK)
|
||||
|
|
|
|||
|
|
@ -36,7 +36,6 @@ int main(int argc, char *argv[])
|
|||
testlib_unused(argc);
|
||||
MPS_ARGS_BEGIN(args) {
|
||||
MPS_ARGS_ADD(args, MPS_KEY_ARENA_SIZE, 600000);
|
||||
MPS_ARGS_DONE(args);
|
||||
testit((ArenaClass)mps_arena_class_vm(), args);
|
||||
} MPS_ARGS_END(args);
|
||||
printf("%s: Conclusion: Failed to find any defects.\n", argv[0]);
|
||||
|
|
|
|||
|
|
@ -767,7 +767,6 @@ static void *test(void *arg, size_t s)
|
|||
|
||||
MPS_ARGS_BEGIN(args) {
|
||||
MPS_ARGS_ADD(args, MPS_KEY_FORMAT, format);
|
||||
MPS_ARGS_DONE(args);
|
||||
die(mps_pool_create_k(&pool, arena, mps_class_amst(), args),
|
||||
"pool_create(amst)");
|
||||
} MPS_ARGS_END(args);
|
||||
|
|
|
|||
|
|
@ -4458,7 +4458,6 @@ int main(int argc, char *argv[])
|
|||
It holds all the MPS "global" state and is where everything happens. */
|
||||
MPS_ARGS_BEGIN(args) {
|
||||
MPS_ARGS_ADD(args, MPS_KEY_ARENA_SIZE, 32 * 1024 * 1024);
|
||||
MPS_ARGS_DONE(args);
|
||||
res = mps_arena_create_k(&arena, mps_arena_class_vm(), args);
|
||||
} MPS_ARGS_END(args);
|
||||
if (res != MPS_RES_OK) error("Couldn't create arena");
|
||||
|
|
@ -4473,7 +4472,6 @@ int main(int argc, char *argv[])
|
|||
MPS_ARGS_ADD(args, MPS_KEY_FMT_FWD, obj_fwd);
|
||||
MPS_ARGS_ADD(args, MPS_KEY_FMT_ISFWD, obj_isfwd);
|
||||
MPS_ARGS_ADD(args, MPS_KEY_FMT_PAD, obj_pad);
|
||||
MPS_ARGS_DONE(args);
|
||||
res = mps_fmt_create_k(&obj_fmt, arena, args);
|
||||
} MPS_ARGS_END(args);
|
||||
if (res != MPS_RES_OK) error("Couldn't create obj format");
|
||||
|
|
@ -4490,7 +4488,6 @@ int main(int argc, char *argv[])
|
|||
MPS_ARGS_BEGIN(args) {
|
||||
MPS_ARGS_ADD(args, MPS_KEY_CHAIN, obj_chain);
|
||||
MPS_ARGS_ADD(args, MPS_KEY_FORMAT, obj_fmt);
|
||||
MPS_ARGS_DONE(args);
|
||||
res = mps_pool_create_k(&obj_pool, arena, mps_class_amc(), args);
|
||||
} MPS_ARGS_END(args);
|
||||
if (res != MPS_RES_OK) error("Couldn't create obj pool");
|
||||
|
|
@ -4507,7 +4504,6 @@ int main(int argc, char *argv[])
|
|||
MPS_ARGS_BEGIN(args) {
|
||||
MPS_ARGS_ADD(args, MPS_KEY_CHAIN, obj_chain);
|
||||
MPS_ARGS_ADD(args, MPS_KEY_FORMAT, obj_fmt);
|
||||
MPS_ARGS_DONE(args);
|
||||
res = mps_pool_create_k(&leaf_pool, arena, mps_class_amcz(), args);
|
||||
} MPS_ARGS_END(args);
|
||||
if (res != MPS_RES_OK) error("Couldn't create leaf pool");
|
||||
|
|
@ -4521,7 +4517,6 @@ int main(int argc, char *argv[])
|
|||
MPS_ARGS_ADD(args, MPS_KEY_FMT_ALIGN, ALIGNMENT);
|
||||
MPS_ARGS_ADD(args, MPS_KEY_FMT_SCAN, buckets_scan);
|
||||
MPS_ARGS_ADD(args, MPS_KEY_FMT_SKIP, buckets_skip);
|
||||
MPS_ARGS_DONE(args);
|
||||
res = mps_fmt_create_k(&buckets_fmt, arena, args);
|
||||
} MPS_ARGS_END(args);
|
||||
if (res != MPS_RES_OK) error("Couldn't create buckets format");
|
||||
|
|
@ -4531,7 +4526,6 @@ int main(int argc, char *argv[])
|
|||
MPS_ARGS_BEGIN(args) {
|
||||
MPS_ARGS_ADD(args, MPS_KEY_FORMAT, buckets_fmt);
|
||||
MPS_ARGS_ADD(args, MPS_KEY_AWL_FIND_DEPENDENT, buckets_find_dependent);
|
||||
MPS_ARGS_DONE(args);
|
||||
res = mps_pool_create_k(&buckets_pool, arena, mps_class_awl(), args);
|
||||
} MPS_ARGS_END(args);
|
||||
if (res != MPS_RES_OK) error("Couldn't create buckets pool");
|
||||
|
|
@ -4539,13 +4533,11 @@ int main(int argc, char *argv[])
|
|||
/* Create allocation points for weak and strong buckets. */
|
||||
MPS_ARGS_BEGIN(args) {
|
||||
MPS_ARGS_ADD(args, MPS_KEY_RANK, mps_rank_exact());
|
||||
MPS_ARGS_DONE(args);
|
||||
res = mps_ap_create_k(&strong_buckets_ap, buckets_pool, args);
|
||||
} MPS_ARGS_END(args);
|
||||
if (res != MPS_RES_OK) error("Couldn't create strong buckets allocation point");
|
||||
MPS_ARGS_BEGIN(args) {
|
||||
MPS_ARGS_ADD(args, MPS_KEY_RANK, mps_rank_weak());
|
||||
MPS_ARGS_DONE(args);
|
||||
res = mps_ap_create_k(&weak_buckets_ap, buckets_pool, args);
|
||||
} MPS_ARGS_END(args);
|
||||
if (res != MPS_RES_OK) error("Couldn't create weak buckets allocation point");
|
||||
|
|
|
|||
|
|
@ -4392,7 +4392,6 @@ int main(int argc, char *argv[])
|
|||
It holds all the MPS "global" state and is where everything happens. */
|
||||
MPS_ARGS_BEGIN(args) {
|
||||
MPS_ARGS_ADD(args, MPS_KEY_ARENA_SIZE, 32 * 1024 * 1024);
|
||||
MPS_ARGS_DONE(args);
|
||||
res = mps_arena_create_k(&arena, mps_arena_class_vm(), args);
|
||||
} MPS_ARGS_END(args);
|
||||
if (res != MPS_RES_OK) error("Couldn't create arena");
|
||||
|
|
@ -4407,7 +4406,6 @@ int main(int argc, char *argv[])
|
|||
MPS_ARGS_ADD(args, MPS_KEY_FMT_FWD, obj_fwd);
|
||||
MPS_ARGS_ADD(args, MPS_KEY_FMT_ISFWD, obj_isfwd);
|
||||
MPS_ARGS_ADD(args, MPS_KEY_FMT_PAD, obj_pad);
|
||||
MPS_ARGS_DONE(args);
|
||||
res = mps_fmt_create_k(&obj_fmt, arena, args);
|
||||
} MPS_ARGS_END(args);
|
||||
if (res != MPS_RES_OK) error("Couldn't create obj format");
|
||||
|
|
@ -4424,7 +4422,6 @@ int main(int argc, char *argv[])
|
|||
MPS_ARGS_BEGIN(args) {
|
||||
MPS_ARGS_ADD(args, MPS_KEY_CHAIN, obj_chain);
|
||||
MPS_ARGS_ADD(args, MPS_KEY_FORMAT, obj_fmt);
|
||||
MPS_ARGS_DONE(args);
|
||||
res = mps_pool_create_k(&obj_pool, arena, mps_class_amc(), args);
|
||||
} MPS_ARGS_END(args);
|
||||
if (res != MPS_RES_OK) error("Couldn't create obj pool");
|
||||
|
|
|
|||
|
|
@ -691,7 +691,6 @@ points::
|
|||
MPS_ARGS_BEGIN(args) {
|
||||
MPS_ARGS_ADD(args, MPS_KEY_FORMAT, buckets_fmt);
|
||||
MPS_ARGS_ADD(args, MPS_KEY_AWL_FIND_DEPENDENT, buckets_find_dependent);
|
||||
MPS_ARGS_DONE(args);
|
||||
res = mps_pool_create_k(&buckets_pool, arena, mps_class_awl(), args);
|
||||
} MPS_ARGS_END(args);
|
||||
if (res != MPS_RES_OK) error("Couldn't create buckets pool");
|
||||
|
|
@ -699,13 +698,11 @@ points::
|
|||
/* Create allocation points for weak and strong buckets. */
|
||||
MPS_ARGS_BEGIN(args) {
|
||||
MPS_ARGS_ADD(args, MPS_KEY_RANK, mps_rank_exact());
|
||||
MPS_ARGS_DONE(args);
|
||||
res = mps_ap_create_k(&strong_buckets_ap, buckets_pool, args);
|
||||
} MPS_ARGS_END(args);
|
||||
if (res != MPS_RES_OK) error("Couldn't create strong buckets allocation point");
|
||||
MPS_ARGS_BEGIN(args) {
|
||||
MPS_ARGS_ADD(args, MPS_KEY_RANK, mps_rank_weak());
|
||||
MPS_ARGS_DONE(args);
|
||||
res = mps_ap_create_k(&weak_buckets_ap, buckets_pool, args);
|
||||
} MPS_ARGS_END(args);
|
||||
if (res != MPS_RES_OK) error("Couldn't create weak buckets allocation point");
|
||||
|
|
@ -880,7 +877,6 @@ Second, the leaf objects must be allocated on ``leaf_ap`` instead of
|
|||
MPS_ARGS_BEGIN(args) {
|
||||
MPS_ARGS_ADD(args, MPS_KEY_CHAIN, obj_chain);
|
||||
MPS_ARGS_ADD(args, MPS_KEY_FORMAT, obj_fmt);
|
||||
MPS_ARGS_DONE(args);
|
||||
res = mps_pool_create_k(&leaf_pool, arena, mps_class_amcz(), args);
|
||||
} MPS_ARGS_END(args);
|
||||
if (res != MPS_RES_OK) error("Couldn't create leaf pool");
|
||||
|
|
|
|||
|
|
@ -177,7 +177,6 @@ Let's reserve 32 megabytes::
|
|||
mps_res_t res;
|
||||
MPS_ARGS_BEGIN(args) {
|
||||
MPS_ARGS_ADD(args, MPS_KEY_ARENA_SIZE, 32 * 1024 * 1024);
|
||||
MPS_ARGS_DONE(args);
|
||||
res = mps_arena_create_k(&arena, mps_arena_class_vm(), args);
|
||||
} MPS_ARGS_END(args);
|
||||
if (res != MPS_RES_OK) error("Couldn't create arena");
|
||||
|
|
@ -263,7 +262,6 @@ code for creating the object format for the toy Scheme interpreter::
|
|||
MPS_ARGS_ADD(args, MPS_KEY_FMT_FWD, obj_fwd);
|
||||
MPS_ARGS_ADD(args, MPS_KEY_FMT_ISFWD, obj_isfwd);
|
||||
MPS_ARGS_ADD(args, MPS_KEY_FMT_PAD, obj_pad);
|
||||
MPS_ARGS_DONE(args);
|
||||
res = mps_fmt_create_k(&obj_fmt, arena, args);
|
||||
} MPS_ARGS_END(args);
|
||||
if (res != MPS_RES_OK) error("Couldn't create obj format");
|
||||
|
|
@ -694,7 +692,6 @@ Second, the :term:`object format`::
|
|||
MPS_ARGS_ADD(args, MPS_KEY_FMT_FWD, obj_fwd);
|
||||
MPS_ARGS_ADD(args, MPS_KEY_FMT_ISFWD, obj_isfwd);
|
||||
MPS_ARGS_ADD(args, MPS_KEY_FMT_PAD, obj_pad);
|
||||
MPS_ARGS_DONE(args);
|
||||
res = mps_fmt_create_k(&obj_fmt, arena, args);
|
||||
} MPS_ARGS_END(args);
|
||||
if (res != MPS_RES_OK) error("Couldn't create obj format");
|
||||
|
|
@ -704,7 +701,6 @@ And finally the :term:`pool`::
|
|||
mps_pool_t obj_pool;
|
||||
MPS_ARGS_BEGIN(args) {
|
||||
MPS_ARGS_ADD(args, MPS_KEY_FORMAT, obj_fmt);
|
||||
MPS_ARGS_DONE(args);
|
||||
res = mps_pool_create_k(&obj_pool, arena, mps_class_amc(), args);
|
||||
} MPS_ARGS_END(args);
|
||||
if (res != MPS_RES_OK) error("Couldn't create obj pool");
|
||||
|
|
|
|||
|
|
@ -123,7 +123,6 @@ AMC interface
|
|||
|
||||
MPS_ARGS_BEGIN(args) {
|
||||
MPS_ARGS_ADD(args, MPS_KEY_FORMAT, fmt);
|
||||
MPS_ARGS_DONE(args);
|
||||
res = mps_pool_create_k(&pool, arena, mps_class_amc(), args);
|
||||
} MPS_ARGS_END(args);
|
||||
|
||||
|
|
|
|||
|
|
@ -78,7 +78,6 @@ AMCZ interface
|
|||
|
||||
MPS_ARGS_BEGIN(args) {
|
||||
MPS_ARGS_ADD(args, MPS_KEY_FORMAT, fmt);
|
||||
MPS_ARGS_DONE(args);
|
||||
res = mps_pool_create_k(&pool, arena, mps_class_amcz(), args);
|
||||
} MPS_ARGS_END(args);
|
||||
|
||||
|
|
|
|||
|
|
@ -134,7 +134,6 @@ AMS interface
|
|||
MPS_ARGS_BEGIN(args) {
|
||||
MPS_ARGS_ADD(args, MPS_KEY_FORMAT, fmt);
|
||||
MPS_ARGS_ADD(args, MPS_KEY_AMS_SUPPORT_AMBIGUOUS, 1);
|
||||
MPS_ARGS_DONE(args);
|
||||
res = mps_pool_create_k(&pool, arena, mps_class_ams(), args);
|
||||
} MPS_ARGS_END(args);
|
||||
|
||||
|
|
@ -164,7 +163,6 @@ AMS interface
|
|||
|
||||
MPS_ARGS_BEGIN(args) {
|
||||
MPS_ARGS_ADD(args, MPS_KEY_RANK, mps_rank_ambig());
|
||||
MPS_ARGS_DONE(args);
|
||||
res = mps_ap_create_k(&ap, ams_pool, args);
|
||||
} MPS_ARGS_END(args);
|
||||
|
||||
|
|
|
|||
|
|
@ -346,7 +346,6 @@ AWL interface
|
|||
MPS_ARGS_BEGIN(args) {
|
||||
MPS_ARGS_ADD(args, MPS_KEY_FORMAT, fmt);
|
||||
MPS_ARGS_ADD(args, MPS_KEY_AWL_FIND_DEPENDENT, find_dependent);
|
||||
MPS_ARGS_DONE(args);
|
||||
res = mps_pool_create_k(&pool, arena, mps_class_awl(), args);
|
||||
} MPS_ARGS_END(args);
|
||||
|
||||
|
|
@ -375,7 +374,6 @@ AWL interface
|
|||
|
||||
MPS_ARGS_BEGIN(args) {
|
||||
MPS_ARGS_ADD(args, MPS_KEY_RANK, mps_rank_weak());
|
||||
MPS_ARGS_DONE(args);
|
||||
res = mps_ap_create_k(&ap, awl_pool, args);
|
||||
} MPS_ARGS_END(args);
|
||||
|
||||
|
|
|
|||
|
|
@ -134,7 +134,6 @@ LO interface
|
|||
|
||||
MPS_ARGS_BEGIN(args) {
|
||||
MPS_ARGS_ADD(args, MPS_KEY_FORMAT, fmt);
|
||||
MPS_ARGS_DONE(args);
|
||||
res = mps_pool_create_k(&pool, arena, mps_class_lo(), args);
|
||||
} MPS_ARGS_END(args);
|
||||
|
||||
|
|
|
|||
|
|
@ -101,7 +101,6 @@ MFS interface
|
|||
MPS_ARGS_BEGIN(args) {
|
||||
MPS_ARGS_ADD(args, MPS_KEY_MFS_UNIT_SIZE, 1024);
|
||||
MPS_ARGS_ADD(args, MPS_KEY_EXTEND_BY, 1024 * 1024);
|
||||
MPS_ARGS_DONE(args);
|
||||
res = mps_pool_create_k(&pool, arena, mps_class_mfs(), args);
|
||||
} MPS_ARGS_END(args);
|
||||
|
||||
|
|
|
|||
|
|
@ -96,7 +96,6 @@ MV interface
|
|||
MPS_ARGS_ADD(args, MPS_KEY_MEAN_SIZE, 32);
|
||||
MPS_ARGS_ADD(args, MPS_KEY_MAX_SIZE, 1024);
|
||||
MPS_ARGS_ADD(args, MPS_KEY_EXTEND_BY, 1024 * 1024);
|
||||
MPS_ARGS_DONE(args);
|
||||
res = mps_pool_create_k(&pool, arena, mps_class_mfs(), args);
|
||||
} MPS_ARGS_END(args);
|
||||
|
||||
|
|
|
|||
|
|
@ -170,7 +170,6 @@ MVFF interface
|
|||
MPS_ARGS_ADD(args, MPS_KEY_MVFF_ARENA_HIGH, 1);
|
||||
MPS_ARGS_ADD(args, MPS_KEY_MVFF_SLOT_HIGH, 1);
|
||||
MPS_ARGS_ADD(args, MPS_KEY_MVFF_FIRST_FIT, 0);
|
||||
MPS_ARGS_DONE(args);
|
||||
res = mps_pool_create_k(&pool, arena, mps_class_mvff(), args);
|
||||
} MPS_ARGS_END(args);
|
||||
|
||||
|
|
|
|||
|
|
@ -191,7 +191,6 @@ MVT interface
|
|||
MPS_ARGS_ADD(args, MPS_KEY_MAX_SIZE, 1024);
|
||||
MPS_ARGS_ADD(args, MPS_KEY_MVT_RESERVE_DEPTH, 256);
|
||||
MPS_ARGS_ADD(args, MPS_KEY_MVT_FRAG_LIMIT, 0.5);
|
||||
MPS_ARGS_DONE(args);
|
||||
res = mps_pool_create_k(&pool, arena, mps_class_mvt(), args);
|
||||
} MPS_ARGS_END(args);
|
||||
|
||||
|
|
|
|||
|
|
@ -108,7 +108,6 @@ SNC introspection
|
|||
|
||||
MPS_ARGS_BEGIN(args) {
|
||||
MPS_ARGS_ADD(args, MPS_KEY_FORMAT, fmt);
|
||||
MPS_ARGS_DONE(args);
|
||||
res = mps_pool_create_k(&pool, arena, mps_class_snc(), args);
|
||||
} MPS_ARGS_END(args);
|
||||
|
||||
|
|
@ -132,7 +131,6 @@ SNC introspection
|
|||
|
||||
MPS_ARGS_BEGIN(args) {
|
||||
MPS_ARGS_ADD(args, MPS_KEY_RANK, mps_rank_exact());
|
||||
MPS_ARGS_DONE(args);
|
||||
res = mps_ap_create_k(&ap, awl_pool, args);
|
||||
} MPS_ARGS_END(args);
|
||||
|
||||
|
|
|
|||
|
|
@ -170,7 +170,6 @@ Client arenas
|
|||
MPS_ARGS_BEGIN(args) {
|
||||
MPS_ARGS_ADD(args, MPS_KEY_ARENA_CL_BASE, base);
|
||||
MPS_ARGS_ADD(args, MPS_KEY_ARENA_SIZE, size);
|
||||
MPS_ARGS_DONE(args);
|
||||
res = mps_arena_create_k(&arena, mps_arena_class_cl(), args);
|
||||
} MPS_ARGS_END(args);
|
||||
|
||||
|
|
@ -281,7 +280,6 @@ Virtual memory arenas
|
|||
|
||||
MPS_ARGS_BEGIN(args) {
|
||||
MPS_ARGS_ADD(args, MPS_KEY_ARENA_SIZE, size);
|
||||
MPS_ARGS_DONE(args);
|
||||
res = mps_arena_create_k(&arena, mps_arena_class_cl(), args);
|
||||
} MPS_ARGS_END(args);
|
||||
|
||||
|
|
|
|||
|
|
@ -74,7 +74,6 @@ For example::
|
|||
MPS_ARGS_BEGIN(args) {
|
||||
MPS_ARGS_ADD(args, MPS_KEY_POOL_DEBUG_OPTIONS, &debug_options);
|
||||
MPS_ARGS_ADD(args, MPS_KEY_FORMAT, &fmt);
|
||||
MPS_ARGS_DONE(args);
|
||||
res = mps_pool_create_k(&pool, arena, mps_class_ams_debug(), args);
|
||||
} MPS_ARGS_END(args);
|
||||
if (res != MPS_RES_OK) error("can't create debug pool");
|
||||
|
|
|
|||
|
|
@ -118,7 +118,6 @@ Interface
|
|||
MPS_ARGS_ADD(args, MPS_KEY_FMT_FWD, obj_fwd);
|
||||
MPS_ARGS_ADD(args, MPS_KEY_FMT_ISFWD, obj_isfwd);
|
||||
MPS_ARGS_ADD(args, MPS_KEY_FMT_PAD, obj_pad);
|
||||
MPS_ARGS_DONE(args);
|
||||
res = mps_fmt_create_k(&obj_fmt, arena, args);
|
||||
} MPS_ARGS_END(args);
|
||||
if (res != MPS_RES_OK) error("Couldn't create obj format");
|
||||
|
|
|
|||
|
|
@ -32,7 +32,6 @@ help with forming keyword argument lists::
|
|||
MPS_ARGS_BEGIN(args) {
|
||||
MPS_ARGS_ADD(args, MPS_KEY_ARENA_SIZE, 6553600);
|
||||
MPS_ARGS_ADD(args, MPS_KEY_ARENA_CL_BASE, base_address);
|
||||
MPS_ARGS_DONE(args);
|
||||
res = mps_arena_create_k(&arena, mps_arena_class_cl(), args);
|
||||
} MPS_ARGS_END(args);
|
||||
|
||||
|
|
@ -128,14 +127,12 @@ now :c:macro:`MPS_KEY_ARGS_END`.
|
|||
MPS_ARGS_BEGIN(args) {
|
||||
MPS_ARGS_ADD(args, MPS_KEY_ARENA_SIZE, 6553600);
|
||||
MPS_ARGS_ADD(args, MPS_KEY_ARENA_CL_BASE, base_address);
|
||||
MPS_ARGS_DONE(args);
|
||||
res = mps_arena_create_k(&arena, mps_arena_class_cl(), args);
|
||||
} MPS_ARGS_END(args);
|
||||
|
||||
That is, you must call :c:func:`MPS_ARGS_ADD` (or
|
||||
:c:func:`MPS_ARGS_ADD_FIELD`) zero or more times, and then call
|
||||
:c:func:`MPS_ARGS_DONE` before passing the arguments to a
|
||||
function.
|
||||
:c:func:`MPS_ARGS_ADD_FIELD`) zero or more times, and then pass
|
||||
the arguments to a function.
|
||||
|
||||
``args`` is the name of the array that contains the keyword
|
||||
arguments. The array is stack-allocated, and exists between
|
||||
|
|
@ -185,19 +182,6 @@ now :c:macro:`MPS_KEY_ARGS_END`.
|
|||
you don't need to look up the name of the field.
|
||||
|
||||
|
||||
.. c:function:: MPS_ARGS_DONE(args)
|
||||
|
||||
Finalize a list of keyword arguments. This macro must be used only
|
||||
between :c:macro:`MPS_ARGS_BEGIN` and :c:macro:`MPS_ARGS_END`.
|
||||
|
||||
``args`` is the name of array that contains the keyword arguments.
|
||||
It must match the argument to the preceding call to
|
||||
:c:func:`MPS_ARGS_BEGIN`.
|
||||
|
||||
After calling this macro, the array ``args`` is ready to pass to a
|
||||
function.
|
||||
|
||||
|
||||
.. c:function:: MPS_ARGS_END(args)
|
||||
|
||||
Finish using a list of keyword arguments whose construction was
|
||||
|
|
@ -206,3 +190,11 @@ now :c:macro:`MPS_KEY_ARGS_END`.
|
|||
``args`` is the name of array that contains the keyword arguments.
|
||||
It must match the argument to the preceding call to
|
||||
:c:func:`MPS_ARGS_BEGIN`.
|
||||
|
||||
|
||||
.. c:function:: MPS_ARGS_DONE(args)
|
||||
|
||||
.. deprecated:: starting with version 1.113.
|
||||
|
||||
Formerly this was used to finalize a list of keyword arguments
|
||||
before passing it to a function. It is no longer needed.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue