diff --git a/mps/code/.gdbinit b/mps/code/.gdbinit deleted file mode 100644 index cbdac5f7cce..00000000000 --- a/mps/code/.gdbinit +++ /dev/null @@ -1 +0,0 @@ -handle SIGBUS nostop diff --git a/mps/code/amsss.c b/mps/code/amsss.c index 67d1018aba8..43d2541f401 100644 --- a/mps/code/amsss.c +++ b/mps/code/amsss.c @@ -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); diff --git a/mps/code/arena.c b/mps/code/arena.c index b1584cb733e..f2e94f99fed 100644 --- a/mps/code/arena.c +++ b/mps/code/arena.c @@ -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); diff --git a/mps/code/arenacv.c b/mps/code/arenacv.c index 10ef9c45314..b52345f9013 100644 --- a/mps/code/arenacv.c +++ b/mps/code/arenacv.c @@ -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) diff --git a/mps/code/arenavm.c b/mps/code/arenavm.c index 2df8d7065b1..fae4419a3fa 100644 --- a/mps/code/arenavm.c +++ b/mps/code/arenavm.c @@ -1,7 +1,7 @@ /* arenavm.c: VIRTUAL MEMORY ARENA CLASS * * $Id$ - * Copyright (c) 2001-2013 Ravenbrook Limited. See end of file for license. + * Copyright (c) 2001-2014 Ravenbrook Limited. See end of file for license. * * * DESIGN @@ -909,6 +909,34 @@ static Bool pagesFindFreeWithSegPref(Index *baseReturn, VMChunk *chunkReturn, } +/* vmArenaChunkSize -- choose chunk size for arena extension + * + * .vmchunk.overhead: This code still lacks a proper estimate of + * the overhead required by a vmChunk for chunkStruct, page tables + * etc. For now, estimate it as 10%. RHSK 2007-12-21 + */ +static Size vmArenaChunkSize(VMArena vmArena, Size size) +{ + Size fraction = 10; /* 10% -- see .vmchunk.overhead */ + Size chunkSize; + Size chunkOverhead; + + /* 1: use extendBy, if it is big enough for size + overhead */ + chunkSize = vmArena->extendBy; + chunkOverhead = chunkSize / fraction; + if(chunkSize > size && (chunkSize - size) >= chunkOverhead) + return chunkSize; + + /* 2: use size + overhead (unless it overflows SizeMAX) */ + chunkOverhead = size / (fraction - 1); + if((SizeMAX - size) >= chunkOverhead) + return size + chunkOverhead; + + /* 3: use SizeMAX */ + return SizeMAX; +} + + /* vmArenaExtend -- Extend the arena by making a new chunk * * The size arg specifies how much we wish to allocate after the extension. @@ -919,31 +947,7 @@ static Res vmArenaExtend(VMArena vmArena, Size size) Size chunkSize; Res res; - /* Choose chunk size. */ - /* .vmchunk.overhead: This code still lacks a proper estimate of */ - /* the overhead required by a vmChunk for chunkStruct, page tables */ - /* etc. For now, estimate it as 10%. RHSK 2007-12-21 */ - do { - Size fraction = 10; /* 10% -- see .vmchunk.overhead */ - Size chunkOverhead; - - /* 1: use extendBy, if it is big enough for size + overhead */ - chunkSize = vmArena->extendBy; - chunkOverhead = chunkSize / fraction; - if(chunkSize > size && (chunkSize - size) >= chunkOverhead) - break; - - /* 2: use size + overhead (unless it overflows SizeMAX) */ - chunkOverhead = size / (fraction - 1); - if((SizeMAX - size) >= chunkOverhead) { - chunkSize = size + chunkOverhead; - break; - } - - /* 3: use SizeMAX */ - chunkSize = SizeMAX; - break; - } while(0); + chunkSize = vmArenaChunkSize(vmArena, size); EVENT3(vmArenaExtendStart, size, chunkSize, VMArenaReserved(VMArena2Arena(vmArena))); @@ -1571,7 +1575,7 @@ mps_arena_class_t mps_arena_class_vmnz(void) /* C. COPYRIGHT AND LICENSE * - * Copyright (C) 2001-2013 Ravenbrook Limited . + * Copyright (C) 2001-2014 Ravenbrook Limited . * All rights reserved. This is an open source license. Contact * Ravenbrook for commercial licensing options. * diff --git a/mps/code/awlut.c b/mps/code/awlut.c index a39ccb7c6cb..25ceb34b29b 100644 --- a/mps/code/awlut.c +++ b/mps/code/awlut.c @@ -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); diff --git a/mps/code/awluthe.c b/mps/code/awluthe.c index 9f450d55c50..6b56d05f78d 100644 --- a/mps/code/awluthe.c +++ b/mps/code/awluthe.c @@ -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); diff --git a/mps/code/cbs.c b/mps/code/cbs.c index dfe98369eb0..096eaa075a5 100644 --- a/mps/code/cbs.c +++ b/mps/code/cbs.c @@ -222,7 +222,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) diff --git a/mps/code/comm.gmk b/mps/code/comm.gmk index 0b48b3678ed..c412ac476e3 100644 --- a/mps/code/comm.gmk +++ b/mps/code/comm.gmk @@ -3,7 +3,7 @@ # comm.gmk: COMMON GNUMAKEFILE FRAGMENT # # $Id$ -# Copyright (c) 2001-2013 Ravenbrook Limited. See end of file for license. +# Copyright (c) 2001-2014 Ravenbrook Limited. See end of file for license. # # DESCRIPTION # @@ -225,17 +225,19 @@ LIB_TARGETS=mps.a mpsplan.a # build) as an automated test case, add it to AUTO_TEST_TARGETS. AUTO_TEST_TARGETS=abqtest amcss amcsshe amcssth amsss amssshe apss \ - arenacv awlut awluthe awlutth btcv exposet0 expt825 fbmtest finalcv \ - finaltest fotest lockcov locv messtest mpmss mpsicv mv2test \ - poolncv qs sacss segsmss steptest walkt0 zmess + arenacv awlut awluthe awlutth btcv exposet0 expt825 fbmtest \ + finalcv finaltest fotest locbwcss lockcov locusss locv messtest \ + mpmss mpsicv mv2test poolncv qs sacss segsmss steptest walkt0 \ + zmess # If it is not runnable as an automated test case, but is buildable, # add it to OTHER_TEST_TARGETS with a note. # # bttest and teletest -- interactive and so cannot be run unattended. +# djbench and gcbench -- benchmarks, not test cases. # zcoll -- takes too long to be useful as a regularly run smoke test. -OTHER_TEST_TARGETS=bttest teletest zcoll +OTHER_TEST_TARGETS=bttest teletest djbench gcbench zcoll # This target records programs that we were once able to build but # can't at the moment: @@ -377,6 +379,9 @@ $(PFM)/$(VARIETY)/btcv: $(PFM)/$(VARIETY)/btcv.o \ $(PFM)/$(VARIETY)/bttest: $(PFM)/$(VARIETY)/bttest.o \ $(TESTLIBOBJ) $(PFM)/$(VARIETY)/mps.a +$(PFM)/$(VARIETY)/djbench: $(PFM)/$(VARIETY)/djbench.o \ + $(TESTLIBOBJ) $(PFM)/$(VARIETY)/mps.a + $(PFM)/$(VARIETY)/exposet0: $(PFM)/$(VARIETY)/exposet0.o \ $(FMTDYTSTOBJ) $(TESTLIBOBJ) $(PFM)/$(VARIETY)/mps.a @@ -395,9 +400,18 @@ $(PFM)/$(VARIETY)/finaltest: $(PFM)/$(VARIETY)/finaltest.o \ $(PFM)/$(VARIETY)/fotest: $(PFM)/$(VARIETY)/fotest.o \ $(TESTLIBOBJ) $(PFM)/$(VARIETY)/mps.a +$(PFM)/$(VARIETY)/gcbench: $(PFM)/$(VARIETY)/gcbench.o \ + $(FMTDYTSTOBJ) $(TESTLIBOBJ) $(PFM)/$(VARIETY)/mps.a + +$(PFM)/$(VARIETY)/locbwcss: $(PFM)/$(VARIETY)/locbwcss.o \ + $(TESTLIBOBJ) $(PFM)/$(VARIETY)/mps.a + $(PFM)/$(VARIETY)/lockcov: $(PFM)/$(VARIETY)/lockcov.o \ $(TESTLIBOBJ) $(PFM)/$(VARIETY)/mps.a +$(PFM)/$(VARIETY)/locusss: $(PFM)/$(VARIETY)/locusss.o \ + $(TESTLIBOBJ) $(PFM)/$(VARIETY)/mps.a + $(PFM)/$(VARIETY)/locv: $(PFM)/$(VARIETY)/locv.o \ $(TESTLIBOBJ) $(PFM)/$(VARIETY)/mps.a @@ -567,7 +581,7 @@ find-puns: phony # C. COPYRIGHT AND LICENSE # -# Copyright (c) 2001-2013 Ravenbrook Limited . +# Copyright (c) 2001-2014 Ravenbrook Limited . # All rights reserved. This is an open source license. Contact # Ravenbrook for commercial licensing options. # diff --git a/mps/code/dbgpool.c b/mps/code/dbgpool.c index be109970b5f..ab0bc7d3cfd 100644 --- a/mps/code/dbgpool.c +++ b/mps/code/dbgpool.c @@ -194,7 +194,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) diff --git a/mps/code/djbench.c b/mps/code/djbench.c index 74fd09dadab..a4fb093a7f6 100644 --- a/mps/code/djbench.c +++ b/mps/code/djbench.c @@ -16,7 +16,6 @@ #include #include #include -#include #include #include "getopt.h" #include "testlib.h" @@ -124,8 +123,8 @@ DJRUN(dj_alloc, MPS_ALLOC, MPS_FREE) #define RESERVE_ALLOC(p, s) \ do { \ size_t _s = ALIGN_UP(s, (size_t)MPS_PF_ALIGN); \ - mps_reserve(&p, ap, _s); \ - mps_commit(ap, p, _s); \ + (void)mps_reserve(&p, ap, _s); \ + (void)mps_commit(ap, p, _s); \ } while(0) #define RESERVE_FREE(p, s) do { mps_free(pool, p, s); } while(0) @@ -187,7 +186,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)); @@ -335,7 +333,7 @@ int main(int argc, char *argv[]) { /* C. COPYRIGHT AND LICENSE * - * Copyright (c) 2001-2013 Ravenbrook Limited . + * Copyright (c) 2001-2014 Ravenbrook Limited . * All rights reserved. This is an open source license. Contact * Ravenbrook for commercial licensing options. * diff --git a/mps/code/fotest.c b/mps/code/fotest.c index 333da328475..cab1d0f4e31 100644 --- a/mps/code/fotest.c +++ b/mps/code/fotest.c @@ -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); { diff --git a/mps/code/gcbench.c b/mps/code/gcbench.c index 77886851d41..5c01ba5d986 100644 --- a/mps/code/gcbench.c +++ b/mps/code/gcbench.c @@ -12,7 +12,6 @@ #include #include #include -#include #include #include "getopt.h" #include "testlib.h" @@ -33,9 +32,6 @@ static mps_arena_t arena; static mps_pool_t pool; static mps_fmt_t format; static mps_chain_t chain; -static mps_gen_param_s genDefault[] = { - { 5 * 1024 * 1024, 0.85 }, - { 50 * 1024 * 1024, 0.45 } }; /* objNULL needs to be odd so that it's ignored in exactRoots. */ #define objNULL ((obj_t)MPS_WORD_CONST(0xDECEA5ED)) @@ -52,6 +48,7 @@ static double pupdate = 0.1; /* probability of update */ static unsigned ngen = 0; /* number of generations specified */ static mps_gen_param_s gen[genLIMIT]; /* generation parameters */ static size_t arenasize = 256ul * 1024 * 1024; /* arena size */ +static unsigned pinleaf = FALSE; /* are leaf objects pinned at start */ typedef struct gcthread_s *gcthread_t; @@ -82,13 +79,13 @@ static void aset(obj_t v, size_t i, obj_t val) { } /* mktree - make a tree of nodes with depth d. */ -static obj_t mktree(mps_ap_t ap, unsigned d) { +static obj_t mktree(mps_ap_t ap, unsigned d, obj_t leaf) { obj_t tree; size_t i; - if (d <= 0) return objNULL; + if (d <= 0) return leaf; tree = mkvector(ap, width); for (i = 0; i < width; ++i) { - aset(tree, i, mktree(ap, d - 1)); + aset(tree, i, mktree(ap, d - 1, leaf)); } return tree; } @@ -154,8 +151,9 @@ static obj_t update_tree(mps_ap_t ap, obj_t oldtree, unsigned d) { static void *gc_tree(gcthread_t thread) { unsigned i, j; mps_ap_t ap = thread->ap; + obj_t leaf = pinleaf ? mktree(ap, 1, objNULL) : objNULL; for (i = 0; i < niter; ++i) { - obj_t tree = mktree(ap, depth); + obj_t tree = mktree(ap, depth, leaf); for (j = 0 ; j < npass; ++j) { if (preuse < 1.0) tree = new_tree(ap, tree, depth); @@ -220,16 +218,16 @@ static void weave1(gcthread_fn_t fn) static void watch(gcthread_fn_t fn, const char *name) { - clock_t start, finish; + clock_t begin, end; - start = clock(); + begin = clock(); if (nthreads == 1) weave1(fn); else weave(fn); - finish = clock(); + end = clock(); - printf("%s: %g\n", name, (double)(finish - start) / CLOCKS_PER_SEC); + printf("%s: %g\n", name, (double)(end - begin) / CLOCKS_PER_SEC); } @@ -241,24 +239,25 @@ 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)); /* Make wrappers now to avoid race condition. */ /* dylan_make_wrappers() uses malloc. */ RESMUST(dylan_make_wrappers()); - RESMUST(mps_chain_create(&chain, arena, ngen, gen)); + if (ngen > 0) + RESMUST(mps_chain_create(&chain, arena, ngen, gen)); MPS_ARGS_BEGIN(args) { MPS_ARGS_ADD(args, MPS_KEY_FORMAT, format); - MPS_ARGS_ADD(args, MPS_KEY_CHAIN, chain); - MPS_ARGS_DONE(args); + if (ngen > 0) + MPS_ARGS_ADD(args, MPS_KEY_CHAIN, chain); RESMUST(mps_pool_create_k(&pool, arena, pool_class, args)); } MPS_ARGS_END(args); watch(fn, name); mps_pool_destroy(pool); mps_fmt_destroy(format); - mps_chain_destroy(chain); + if (ngen > 0) + mps_chain_destroy(chain); mps_arena_destroy(arena); } @@ -276,6 +275,8 @@ static struct option longopts[] = { {"depth", required_argument, NULL, 'd'}, {"preuse", required_argument, NULL, 'r'}, {"pupdate", required_argument, NULL, 'u'}, + {"pin-leaf", no_argument, NULL, 'l'}, + {"seed", required_argument, NULL, 'x'}, {NULL, 0, NULL, 0} }; @@ -295,10 +296,17 @@ static struct { int main(int argc, char *argv[]) { int ch; unsigned i; + int k; seed = rnd_seed(); + for(k=0; k 0) { diff --git a/mps/code/locbwcss.c b/mps/code/locbwcss.c index 5f9d6095623..33639aab907 100644 --- a/mps/code/locbwcss.c +++ b/mps/code/locbwcss.c @@ -1,7 +1,7 @@ /* locbwcss.c: LOCUS BACKWARDS COMPATIBILITY STRESS TEST * * $Id$ - * Copyright (c) 2001-2013 Ravenbrook Limited. See end of file for license. + * Copyright (c) 2001-2014 Ravenbrook Limited. See end of file for license. */ #include "mpscmvff.h" @@ -129,7 +129,7 @@ static void allocMultiple(PoolStat stat) /* reportResults - print a report on a PoolStat */ -static void reportResults(PoolStat stat, char *name) +static void reportResults(PoolStat stat, const char *name) { printf("\nResults for "); fputs(name, stdout); @@ -210,7 +210,7 @@ int main(int argc, char *argv[]) /* C. COPYRIGHT AND LICENSE * - * Copyright (c) 2001-2013 Ravenbrook Limited . + * Copyright (c) 2001-2014 Ravenbrook Limited . * All rights reserved. This is an open source license. Contact * Ravenbrook for commercial licensing options. * diff --git a/mps/code/locusss.c b/mps/code/locusss.c index c9a86fa37dc..aab01d6f56c 100644 --- a/mps/code/locusss.c +++ b/mps/code/locusss.c @@ -1,7 +1,7 @@ /* locusss.c: LOCUS STRESS TEST * * $Id$ - * Copyright (c) 2001-2013 Ravenbrook Limited. See end of file for license. + * Copyright (c) 2001-2014 Ravenbrook Limited. See end of file for license. */ #include "mpscmvff.h" @@ -133,7 +133,7 @@ static mps_res_t allocMultiple(PoolStat stat) /* reportResults - print a report on a PoolStat */ -static void reportResults(PoolStat stat, char *name) +static void reportResults(PoolStat stat, const char *name) { printf("\nResults for "); printf("%s", name); @@ -251,7 +251,7 @@ int main(int argc, char *argv[]) /* C. COPYRIGHT AND LICENSE * - * Copyright (c) 2001-2013 Ravenbrook Limited . + * Copyright (c) 2001-2014 Ravenbrook Limited . * All rights reserved. This is an open source license. Contact * Ravenbrook for commercial licensing options. * diff --git a/mps/code/mps.h b/mps/code/mps.h index f8751d01372..a767da3b29d 100644 --- a/mps/code/mps.h +++ b/mps/code/mps.h @@ -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) \ diff --git a/mps/code/mps.xcodeproj/project.pbxproj b/mps/code/mps.xcodeproj/project.pbxproj index ce50fa3d214..d546be9ad6e 100644 --- a/mps/code/mps.xcodeproj/project.pbxproj +++ b/mps/code/mps.xcodeproj/project.pbxproj @@ -47,7 +47,9 @@ 3114A5EA156E93C4001E0AA3 /* PBXTargetDependency */, 224CC79D175E187C002FF81B /* PBXTargetDependency */, 22B2BC3F18B643B700C33E63 /* PBXTargetDependency */, + 2231BB6D18CA986B002D6322 /* PBXTargetDependency */, 31D60034156D3D5A00337B26 /* PBXTargetDependency */, + 2231BB6F18CA986D002D6322 /* PBXTargetDependency */, 3114A5A0156E915A001E0AA3 /* PBXTargetDependency */, 3114A6A7156E9739001E0AA3 /* PBXTargetDependency */, 3104AFFE156D37C6000A585A /* PBXTargetDependency */, @@ -74,6 +76,12 @@ /* End PBXAggregateTarget section */ /* Begin PBXBuildFile section */ + 2231BB5118CA97D8002D6322 /* testlib.c in Sources */ = {isa = PBXBuildFile; fileRef = 31EEAC9E156AB73400714D05 /* testlib.c */; }; + 2231BB5318CA97D8002D6322 /* libmps.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 31EEABFB156AAF9D00714D05 /* libmps.a */; }; + 2231BB5F18CA97DC002D6322 /* testlib.c in Sources */ = {isa = PBXBuildFile; fileRef = 31EEAC9E156AB73400714D05 /* testlib.c */; }; + 2231BB6118CA97DC002D6322 /* libmps.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 31EEABFB156AAF9D00714D05 /* libmps.a */; }; + 2231BB6A18CA984F002D6322 /* locusss.c in Sources */ = {isa = PBXBuildFile; fileRef = 2231BB6918CA983C002D6322 /* locusss.c */; }; + 2231BB6B18CA9861002D6322 /* locbwcss.c in Sources */ = {isa = PBXBuildFile; fileRef = 2231BB6818CA9834002D6322 /* locbwcss.c */; }; 224CC791175E1821002FF81B /* testlib.c in Sources */ = {isa = PBXBuildFile; fileRef = 31EEAC9E156AB73400714D05 /* testlib.c */; }; 224CC793175E1821002FF81B /* libmps.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 31EEABFB156AAF9D00714D05 /* libmps.a */; }; 224CC79F175E321C002FF81B /* mv2test.c in Sources */ = {isa = PBXBuildFile; fileRef = 3114A686156E9674001E0AA3 /* mv2test.c */; }; @@ -261,6 +269,34 @@ /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ + 2231BB4E18CA97D8002D6322 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 31EEABDA156AAE9E00714D05 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 31EEABFA156AAF9D00714D05; + remoteInfo = mps; + }; + 2231BB5C18CA97DC002D6322 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 31EEABDA156AAE9E00714D05 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 31EEABFA156AAF9D00714D05; + remoteInfo = mps; + }; + 2231BB6C18CA986B002D6322 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 31EEABDA156AAE9E00714D05 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 2231BB4C18CA97D8002D6322; + remoteInfo = locbwcss; + }; + 2231BB6E18CA986D002D6322 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 31EEABDA156AAE9E00714D05 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 2231BB5A18CA97DC002D6322; + remoteInfo = locusss; + }; 224CC78E175E1821002FF81B /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 31EEABDA156AAE9E00714D05 /* Project object */; @@ -810,6 +846,24 @@ /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ + 2231BB5418CA97D8002D6322 /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = /usr/share/man/man1/; + dstSubfolderSpec = 0; + files = ( + ); + runOnlyForDeploymentPostprocessing = 1; + }; + 2231BB6218CA97DC002D6322 /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = /usr/share/man/man1/; + dstSubfolderSpec = 0; + files = ( + ); + runOnlyForDeploymentPostprocessing = 1; + }; 224CC794175E1821002FF81B /* CopyFiles */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; @@ -1182,6 +1236,10 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 2231BB5918CA97D8002D6322 /* locbwcss */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = locbwcss; sourceTree = BUILT_PRODUCTS_DIR; }; + 2231BB6718CA97DC002D6322 /* locusss */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = locusss; sourceTree = BUILT_PRODUCTS_DIR; }; + 2231BB6818CA9834002D6322 /* locbwcss.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = locbwcss.c; sourceTree = ""; }; + 2231BB6918CA983C002D6322 /* locusss.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = locusss.c; sourceTree = ""; }; 224CC799175E1821002FF81B /* fotest */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = fotest; sourceTree = BUILT_PRODUCTS_DIR; }; 224CC79E175E3202002FF81B /* fotest.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = fotest.c; sourceTree = ""; }; 2291A5A8175CAA51001D4920 /* poolmv2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = poolmv2.h; sourceTree = ""; }; @@ -1469,6 +1527,22 @@ /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ + 2231BB5218CA97D8002D6322 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 2231BB5318CA97D8002D6322 /* libmps.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 2231BB6018CA97DC002D6322 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 2231BB6118CA97DC002D6322 /* libmps.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 224CC792175E1821002FF81B /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -1938,7 +2012,9 @@ 3124CAE4156BE6D500753214 /* fmthe.c */, 3124CACC156BE4C200753214 /* fmtno.c */, 224CC79E175E3202002FF81B /* fotest.c */, + 2231BB6818CA9834002D6322 /* locbwcss.c */, 31D60036156D3E0200337B26 /* lockcov.c */, + 2231BB6918CA983C002D6322 /* locusss.c */, 3114A5A1156E9168001E0AA3 /* locv.c */, 3114A69F156E9725001E0AA3 /* messtest.c */, 31EEAC74156AB58E00714D05 /* mpmss.c */, @@ -2041,6 +2117,8 @@ 318DA8CD1892B0F30089718C /* djbench */, 6313D47218A400B200EB03EF /* gcbench */, 22B2BC3618B6434F00C33E63 /* scheme-advanced */, + 2231BB5918CA97D8002D6322 /* locbwcss */, + 2231BB6718CA97DC002D6322 /* locusss */, ); name = Products; sourceTree = ""; @@ -2218,6 +2296,42 @@ /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ + 2231BB4C18CA97D8002D6322 /* locbwcss */ = { + isa = PBXNativeTarget; + buildConfigurationList = 2231BB5518CA97D8002D6322 /* Build configuration list for PBXNativeTarget "locbwcss" */; + buildPhases = ( + 2231BB4F18CA97D8002D6322 /* Sources */, + 2231BB5218CA97D8002D6322 /* Frameworks */, + 2231BB5418CA97D8002D6322 /* CopyFiles */, + ); + buildRules = ( + ); + dependencies = ( + 2231BB4D18CA97D8002D6322 /* PBXTargetDependency */, + ); + name = locbwcss; + productName = lockcov; + productReference = 2231BB5918CA97D8002D6322 /* locbwcss */; + productType = "com.apple.product-type.tool"; + }; + 2231BB5A18CA97DC002D6322 /* locusss */ = { + isa = PBXNativeTarget; + buildConfigurationList = 2231BB6318CA97DC002D6322 /* Build configuration list for PBXNativeTarget "locusss" */; + buildPhases = ( + 2231BB5D18CA97DC002D6322 /* Sources */, + 2231BB6018CA97DC002D6322 /* Frameworks */, + 2231BB6218CA97DC002D6322 /* CopyFiles */, + ); + buildRules = ( + ); + dependencies = ( + 2231BB5B18CA97DC002D6322 /* PBXTargetDependency */, + ); + name = locusss; + productName = lockcov; + productReference = 2231BB6718CA97DC002D6322 /* locusss */; + productType = "com.apple.product-type.tool"; + }; 224CC78C175E1821002FF81B /* fotest */ = { isa = PBXNativeTarget; buildConfigurationList = 224CC795175E1821002FF81B /* Build configuration list for PBXNativeTarget "fotest" */; @@ -3011,7 +3125,9 @@ 3114A5D5156E93A0001E0AA3 /* finaltest */, 224CC78C175E1821002FF81B /* fotest */, 6313D46718A400B200EB03EF /* gcbench */, + 2231BB4C18CA97D8002D6322 /* locbwcss */, 31D60026156D3D3E00337B26 /* lockcov */, + 2231BB5A18CA97DC002D6322 /* locusss */, 3114A58F156E913C001E0AA3 /* locv */, 3114A694156E971B001E0AA3 /* messtest */, 31EEAC64156AB52600714D05 /* mpmss */, @@ -3047,12 +3163,30 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "# Not listed here:\n# awlutth -- fails (job003506).\n# bttest and teletest -- interactive and so cannot be run unattended.\n# zcoll -- takes too long to be useful as a regularly run smoke test.\nTESTCASES=\"abqtest amcss amcsshe amcssth amsss amssshe apss arenacv \\\n awlut awlutth awluthe btcv expt825 exposet0 fbmtest finalcv \\\n finaltest fotest lockcov locv messtest mpmss mpsicv mv2test \\\n poolncv qs sacss segsmss steptest walkt0 zmess\"\n\n../tool/testrun.sh $(for TEST in $TESTCASES; do echo $TARGET_BUILD_DIR/$TEST; done)\n\n# Coverage\nif [ \"$CONFIGURATION\" == \"Debug\" ]; then\n (cd xc/$PROJECT.build/$CONFIGURATION/$PROJECT.build/Objects-normal/x86_64 &&\n gcov mps.c 2> /dev/null) | ../tool/gcovfmt.py\nfi"; + shellScript = "# Not listed here:\n# bttest and teletest -- interactive and so cannot be run unattended.\n# djbench and gcbench -- benchmarks, not test cases.\n# zcoll -- takes too long to be useful as a regularly run smoke test.\nTESTCASES=\"abqtest amcss amcsshe amcssth amsss amssshe apss arenacv \\\n awlut awlutth awluthe btcv expt825 exposet0 fbmtest finalcv \\\n finaltest fotest locbwcss lockcov locusss locv messtest mpmss \\\n mpsicv mv2test poolncv qs sacss segsmss steptest walkt0 zmess\"\n\n../tool/testrun.sh $(for TEST in $TESTCASES; do echo $TARGET_BUILD_DIR/$TEST; done)\n\n# Coverage\nif [ \"$CONFIGURATION\" == \"Debug\" ]; then\n (cd xc/$PROJECT.build/$CONFIGURATION/$PROJECT.build/Objects-normal/x86_64 &&\n gcov mps.c 2> /dev/null) | ../tool/gcovfmt.py\nfi"; showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ + 2231BB4F18CA97D8002D6322 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 2231BB6B18CA9861002D6322 /* locbwcss.c in Sources */, + 2231BB5118CA97D8002D6322 /* testlib.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 2231BB5D18CA97DC002D6322 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 2231BB6A18CA984F002D6322 /* locusss.c in Sources */, + 2231BB5F18CA97DC002D6322 /* testlib.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 224CC78F175E1821002FF81B /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -3497,6 +3631,26 @@ /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ + 2231BB4D18CA97D8002D6322 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 31EEABFA156AAF9D00714D05 /* mps */; + targetProxy = 2231BB4E18CA97D8002D6322 /* PBXContainerItemProxy */; + }; + 2231BB5B18CA97DC002D6322 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 31EEABFA156AAF9D00714D05 /* mps */; + targetProxy = 2231BB5C18CA97DC002D6322 /* PBXContainerItemProxy */; + }; + 2231BB6D18CA986B002D6322 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 2231BB4C18CA97D8002D6322 /* locbwcss */; + targetProxy = 2231BB6C18CA986B002D6322 /* PBXContainerItemProxy */; + }; + 2231BB6F18CA986D002D6322 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 2231BB5A18CA97DC002D6322 /* locusss */; + targetProxy = 2231BB6E18CA986D002D6322 /* PBXContainerItemProxy */; + }; 224CC78D175E1821002FF81B /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 31EEABFA156AAF9D00714D05 /* mps */; @@ -3890,6 +4044,60 @@ /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ + 2231BB5618CA97D8002D6322 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_GENERATE_TEST_COVERAGE_FILES = YES; + GCC_INSTRUMENT_PROGRAM_FLOW_ARCS = YES; + PRODUCT_NAME = locbwcss; + }; + name = Debug; + }; + 2231BB5718CA97D8002D6322 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_GENERATE_TEST_COVERAGE_FILES = NO; + GCC_INSTRUMENT_PROGRAM_FLOW_ARCS = NO; + PRODUCT_NAME = locbwcss; + }; + name = Release; + }; + 2231BB5818CA97D8002D6322 /* RASH */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_GENERATE_TEST_COVERAGE_FILES = NO; + GCC_INSTRUMENT_PROGRAM_FLOW_ARCS = NO; + PRODUCT_NAME = locbwcss; + }; + name = RASH; + }; + 2231BB6418CA97DC002D6322 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_GENERATE_TEST_COVERAGE_FILES = YES; + GCC_INSTRUMENT_PROGRAM_FLOW_ARCS = YES; + PRODUCT_NAME = locusss; + }; + name = Debug; + }; + 2231BB6518CA97DC002D6322 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_GENERATE_TEST_COVERAGE_FILES = NO; + GCC_INSTRUMENT_PROGRAM_FLOW_ARCS = NO; + PRODUCT_NAME = locusss; + }; + name = Release; + }; + 2231BB6618CA97DC002D6322 /* RASH */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_GENERATE_TEST_COVERAGE_FILES = NO; + GCC_INSTRUMENT_PROGRAM_FLOW_ARCS = NO; + PRODUCT_NAME = locusss; + }; + name = RASH; + }; 224CC796175E1821002FF81B /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -5231,6 +5439,26 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ + 2231BB5518CA97D8002D6322 /* Build configuration list for PBXNativeTarget "locbwcss" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 2231BB5618CA97D8002D6322 /* Debug */, + 2231BB5718CA97D8002D6322 /* Release */, + 2231BB5818CA97D8002D6322 /* RASH */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 2231BB6318CA97DC002D6322 /* Build configuration list for PBXNativeTarget "locusss" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 2231BB6418CA97DC002D6322 /* Debug */, + 2231BB6518CA97DC002D6322 /* Release */, + 2231BB6618CA97DC002D6322 /* RASH */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; 224CC795175E1821002FF81B /* Build configuration list for PBXNativeTarget "fotest" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/mps/code/mpsi.c b/mps/code/mpsi.c index eb7fdb89558..1d52208be9a 100644 --- a/mps/code/mpsi.c +++ b/mps/code/mpsi.c @@ -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); diff --git a/mps/code/mv2test.c b/mps/code/mv2test.c index 29e5606327a..10f7f3353c5 100644 --- a/mps/code/mv2test.c +++ b/mps/code/mv2test.c @@ -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); diff --git a/mps/code/pool.c b/mps/code/pool.c index df6b0fa9032..0524d69525c 100644 --- a/mps/code/pool.c +++ b/mps/code/pool.c @@ -1,7 +1,7 @@ /* pool.c: POOL IMPLEMENTATION * * $Id$ - * Copyright (c) 2001-2013 Ravenbrook Limited. See end of file for license. + * Copyright (c) 2001-2014 Ravenbrook Limited. See end of file for license. * Portions copyright (C) 2001 Global Graphics Software. * * DESIGN @@ -409,14 +409,14 @@ Res PoolScan(Bool *totalReturn, ScanState ss, Pool pool, Seg seg) Res (PoolFix)(Pool pool, ScanState ss, Seg seg, Addr *refIO) { - AVERT(Pool, pool); - AVERT(ScanState, ss); - AVERT(Seg, seg); - AVER(pool == SegPool(seg)); - AVER(refIO != NULL); + AVERT_CRITICAL(Pool, pool); + AVERT_CRITICAL(ScanState, ss); + AVERT_CRITICAL(Seg, seg); + AVER_CRITICAL(pool == SegPool(seg)); + AVER_CRITICAL(refIO != NULL); /* Should only be fixing references to white segments. */ - AVER(TraceSetInter(SegWhite(seg), ss->traces) != TraceSetEMPTY); + AVER_CRITICAL(TraceSetInter(SegWhite(seg), ss->traces) != TraceSetEMPTY); return PoolFix(pool, ss, seg, refIO); } @@ -425,17 +425,17 @@ Res PoolFixEmergency(Pool pool, ScanState ss, Seg seg, Addr *refIO) { Res res; - AVERT(Pool, pool); - AVERT(ScanState, ss); - AVERT(Seg, seg); - AVER(pool == SegPool(seg)); - AVER(refIO != NULL); + AVERT_CRITICAL(Pool, pool); + AVERT_CRITICAL(ScanState, ss); + AVERT_CRITICAL(Seg, seg); + AVER_CRITICAL(pool == SegPool(seg)); + AVER_CRITICAL(refIO != NULL); /* Should only be fixing references to white segments. */ - AVER(TraceSetInter(SegWhite(seg), ss->traces) != TraceSetEMPTY); + AVER_CRITICAL(TraceSetInter(SegWhite(seg), ss->traces) != TraceSetEMPTY); res = (pool->class->fixEmergency)(pool, ss, seg, refIO); - AVER(res == ResOK); + AVER_CRITICAL(res == ResOK); return res; } @@ -684,7 +684,7 @@ Bool PoolHasRange(Pool pool, Addr base, Addr limit) /* C. COPYRIGHT AND LICENSE * - * Copyright (C) 2001-2013 Ravenbrook Limited . + * Copyright (C) 2001-2014 Ravenbrook Limited . * All rights reserved. This is an open source license. Contact * Ravenbrook for commercial licensing options. * diff --git a/mps/code/poolamc.c b/mps/code/poolamc.c index b6ce34ff624..d7d8e0cbfd1 100644 --- a/mps/code/poolamc.c +++ b/mps/code/poolamc.c @@ -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); diff --git a/mps/code/poolawl.c b/mps/code/poolawl.c index 26979c6c2f2..83890b34b6e 100644 --- a/mps/code/poolawl.c +++ b/mps/code/poolawl.c @@ -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); diff --git a/mps/code/poolmrg.c b/mps/code/poolmrg.c index 8e8086ae16c..c945029a9db 100644 --- a/mps/code/poolmrg.c +++ b/mps/code/poolmrg.c @@ -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); diff --git a/mps/code/poolmv.c b/mps/code/poolmv.c index 14cf2c12ce2..9acd64380f6 100644 --- a/mps/code/poolmv.c +++ b/mps/code/poolmv.c @@ -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) diff --git a/mps/code/poolncv.c b/mps/code/poolncv.c index 3df734a3df8..deee10715da 100644 --- a/mps/code/poolncv.c +++ b/mps/code/poolncv.c @@ -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]); diff --git a/mps/code/protxc.c b/mps/code/protxc.c index fbd399b4878..8f62bb3a5df 100644 --- a/mps/code/protxc.c +++ b/mps/code/protxc.c @@ -1,7 +1,7 @@ /* protxc.c: PROTECTION EXCEPTION HANDLER FOR OS X MACH * * $Id$ - * Copyright (c) 2013 Ravenbrook Limited. See end of file for license. + * Copyright (c) 2013-2014 Ravenbrook Limited. See end of file for license. * * This is the protection exception handling code for OS X using the * Mach interface (not pthreads). @@ -283,9 +283,9 @@ static void protCatchOne(void) */ static void *protCatchThread(void *p) { + UNUSED(p); for (;;) protCatchOne(); - return p; } @@ -403,7 +403,7 @@ void ProtSetup(void) /* C. COPYRIGHT AND LICENSE * - * Copyright (C) 2013 Ravenbrook Limited . + * Copyright (C) 2013-2014 Ravenbrook Limited . * All rights reserved. This is an open source license. Contact * Ravenbrook for commercial licensing options. * diff --git a/mps/code/segsmss.c b/mps/code/segsmss.c index a1d53669494..2e071e6dc0f 100644 --- a/mps/code/segsmss.c +++ b/mps/code/segsmss.c @@ -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);