diff --git a/mps/test/data/af_six.txt b/mps/test/data/af_six.txt deleted file mode 100644 index 48094e2d841..00000000000 --- a/mps/test/data/af_six.txt +++ /dev/null @@ -1,17 +0,0 @@ -af_six - -allocate and free log for temp pool in ScriptWorks. - -trunk of 1998-09-10, -30MB for rip, separations, 1024dpi, testhqn, extra grays. - -Jobs ripped: - mnchenwk.ps - ausenpln.ps - hgp101.hpg - a1p101.hpg - musician.ps - radiocas.ps - -Log generated with anchovy.3, variety.ti, dumper.exe and alloclog.pl. - diff --git a/mps/test/function/102.c b/mps/test/function/102.c deleted file mode 100644 index 4d7dbd782ef..00000000000 --- a/mps/test/function/102.c +++ /dev/null @@ -1,176 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = EPDL allocation test - language = c - link = testlib.o -END_HEADER -*/ - -#include -#include "testlib.h" -#include "mpscepdl.h" -#include "mpsavm.h" - -#define MAXNUMBER 1000000 - -void *stackpointer; -mps_space_t space; - -static struct {mps_addr_t addr; size_t size;} queue[MAXNUMBER]; - -enum {SEQ=0, RAN=1, SEQGAP=2, RANGAP=3, DUMMY=4}; -static char *tdesc[] = {"sequential", "random", - "sequential gap", "random gap", "dummy"}; - -static void setobj(mps_addr_t a, size_t size, unsigned char val) -{ - unsigned char *b; - b = a; - - while (size>0) - { - *b=val; - /* comment("%p = %i", b, (int) val); - */ - b++; - size--; - } -} - -static int chkobj(mps_addr_t a, size_t size, unsigned char val) -{ - unsigned char *b; - b = a; - - while (size>0) - { - /* comment("%p == %i", b, (int) val); - */ - if (*b != val) return 0; - b++; - size--; - } - return 1; -} - -static void dt(int kind, - size_t extendBy, size_t avgSize, size_t maxSize, - size_t mins, size_t maxs, int number, int iter) -{ - mps_pool_t pool; - int i, hd; - clock_t time0, time1; - size_t size; - int secs; - - asserts(number <= MAXNUMBER, "number too big"); - - time0 = clock(); - asserts(time0 != -1, "processor time not available"); - - die( - mps_pool_create(&pool, space, mps_class_epdl(), - extendBy, avgSize, 8), - "create pool"); - - for(hd=0; hd -#include "testlib.h" -#include "mpscepdl.h" -#include "mpsavm.h" - -#define MAXNUMBER 1000000 - -void *stackpointer; -mps_space_t space; - -static struct {mps_addr_t addr; size_t size;} queue[MAXNUMBER]; - -enum {SEQ=0, RAN=1, SEQGAP=2, RANGAP=3, DUMMY=4}; -static char *tdesc[] = {"sequential", "random", - "sequential gap", "random gap", "dummy"}; - -static void setobj(mps_addr_t a, size_t size, unsigned char val) -{ - unsigned char *b; - b = a; - - while (size>0) - { - *b=val; - /* comment("%p = %i", b, (int) val); - */ - b++; - size--; - } -} - -static int chkobj(mps_addr_t a, size_t size, unsigned char val) -{ - unsigned char *b; - b = a; - - while (size>0) - { - /* comment("%p == %i", b, (int) val); - */ - if (*b != val) return 0; - b++; - size--; - } - return 1; -} - -static void dt(int kind, - size_t extendBy, size_t avgSize, size_t maxSize, - size_t mins, size_t maxs, int number, int iter) -{ - mps_pool_t pool; - int i, hd; - clock_t time0, time1; - size_t size; - int secs; - - asserts(number <= MAXNUMBER, "number too big"); - - time0 = clock(); - asserts(time0 != -1, "processor time not available"); - - die( - mps_pool_create(&pool, space, mps_class_epdl(), - extendBy, avgSize, 8), - "create pool"); - - for(hd=0; hd= 0; p--) { - if (pooli[p]) { - mps_pool_destroy(pooli[p]); - } - } - mps_fmt_destroy(format); -no_fmt: - mps_thread_dereg(thread); -no_thread: - mps_arena_destroy(arena); -no_arena: - a = NULL; -} - -static void test(void) -{ - int i; - - for (i = 0; i <1024; i ++) { - tryout(1024*64, i); - } -} - -int main(void) { - void *m; - stackpointer=&m; - - easy_tramp(test); - pass(); - return 0; -} - - - diff --git a/mps/test/function/146.c b/mps/test/function/146.c deleted file mode 100644 index e21b5af2223..00000000000 --- a/mps/test/function/146.c +++ /dev/null @@ -1,106 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = EPVM low-memory test - language = c - link = testlib.o epvmfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscepvm.h" -#include "mpsavm.h" -#include "epvmfmt.h" - -#define MAX_SAVE 10 -#define INIT_SAVE 0 -#define OBJ_SIZE 8 - -#define MAXAPS 4096 - -void *stackpointer; - -static mps_ap_t api[MAXAPS]; - -static void tryout(size_t comlimit, int aps) { - mps_arena_t arena; - mps_thr_t thread; - mps_fmt_t format; - mps_pool_t pool, pool1; - mps_ap_t ap; - psobj *a; - int i, p; - - comment("Limit: %lu, aps: %d", (unsigned long) comlimit, aps); - if (mps_arena_create(&arena, mps_arena_class_vm(), (size_t) (1024*1024*128))) - goto no_arena; - - mps_arena_commit_limit_set(arena, comlimit); - - if (mps_thread_reg(&thread, arena)) goto no_thread; - - if (mps_fmt_create_A(&format, arena, &fmtepvm)) goto no_fmt; - - if (mps_pool_create(&pool1, arena, mps_class_epvm(), format, 10, 0)) - goto no_pool; - - for (p = 0; p < aps; p ++) { - if (mps_ap_create(&api[p], pool1, 0)) { - break; - }; - } - - if (mps_pool_create(&pool, arena, mps_class_epvm(), format, 10, 0)) - goto no_pool2; - - if (mps_ap_create(&ap, pool, 0)) goto no_ap; - - allocrepvm(&a, ap, OBJ_SIZE); - mps_epvm_save(pool); - allocrepvm(&a, ap, OBJ_SIZE); - mps_epvm_save(pool); - for (i=0; i<100; i++) { - allocrepvm(&a, ap, OBJ_SIZE); - } - mps_epvm_restore(pool, 0); - - mps_ap_destroy(ap); -no_ap: - mps_pool_destroy(pool); -no_pool2: - for (; p >= 0; p--) { - if (api[p]) { - mps_ap_destroy(api[p]); - } - } - mps_pool_destroy(pool1); -no_pool: - mps_fmt_destroy(format); -no_fmt: - mps_thread_dereg(thread); -no_thread: - mps_arena_destroy(arena); -no_arena: - a = NULL; -} - -static void test(void) -{ - int i; - - for (i = 0; i < MAXAPS; i ++) { - tryout(1024*64, i); - } -} - -int main(void) { - void *m; - stackpointer=&m; - - easy_tramp(test); - pass(); - return 0; -} - - - diff --git a/mps/test/function/154.c b/mps/test/function/154.c deleted file mode 100644 index 418e42aff43..00000000000 --- a/mps/test/function/154.c +++ /dev/null @@ -1,73 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!154.c(trunk.1) $ - summary = EPVM allocate and epvm_collect, once only - language = c - link = testlib.o epvmfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscepvm.h" -#include "mpsavm.h" -#include "epvmfmt.h" - -#define MAX_SAVE 1000 -#define INIT_SAVE 12 - -void *stackpointer; - -static void test(void) -{ - mps_arena_t arena; - mps_thr_t thread; - - mps_fmt_t format; - - mps_pool_t pool1; - mps_ap_t ap1s; - - int j; - - psobj *a; - -/* create an arena that can't grow beyond 64M */ - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), (size_t) (1024*1024*64)), - "create arena"); - - cdie(mps_thread_reg(&thread, arena), "register thread"); - - cdie(mps_fmt_create_A(&format, arena, &fmtepvm), "create format"); - - cdie(mps_pool_create(&pool1, arena, mps_class_epvm(), - format, MAX_SAVE, INIT_SAVE), "create pool1"); - - cdie(mps_ap_create(&ap1s, pool1, 0), "create ap1s"); - - for (j=0; j<3000; j++) { - a = allocepvm(ap1s, (size_t) (8+8*ranint(500))); - } - comment("collecting..."); - mps_epvm_collect(pool1); - - mps_ap_destroy(ap1s); - mps_pool_destroy(pool1); - mps_fmt_destroy(format); - mps_thread_dereg(thread); - mps_arena_destroy(arena); - comment("Destroyed arena"); - -} - -int main(void) { - void *m; - stackpointer=&m; - - easy_tramp(test); - pass(); - return 0; -} - - - diff --git a/mps/test/function/155.c b/mps/test/function/155.c deleted file mode 100644 index 8cf8bdfac7d..00000000000 --- a/mps/test/function/155.c +++ /dev/null @@ -1,64 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!155.c(trunk.1) $ - summary = EPDL fenceposting check - language = c - link = testlib.o -OUTPUT_SPEC - assert = true - assertfile P= dbgpool.c -END_HEADER -*/ - -#include "testlib.h" -#include "mpscepdl.h" -#include "mpsavm.h" - -void *stackpointer; -mps_arena_t arena; - -static mps_pool_debug_option_s debugOpts = {(void *)"bibblebo", 8}; - -static void test(void) { - mps_thr_t thread; - mps_pool_t pool; - mps_addr_t a; - char *c; - - cdie(mps_arena_create(&arena, mps_arena_class_vmnz(), - (size_t) (1024*1024*50)), "create arena"); - cdie(mps_thread_reg(&thread, arena), "register thread"); - - die( - mps_pool_create(&pool, arena, mps_class_epdl_debug(), &debugOpts, - 8192, 8, 8), - "create MVFF pool"); - - die(mps_alloc(&a, pool, 64), "alloc a"); - - c = a; - c -= 1; - *c = 0; - - mps_pool_check_fenceposts(pool); - comment("Fencepost check."); - - c += 67; - *c = 0; - - mps_pool_check_fenceposts(pool); - comment("Fencepost check."); - - mps_pool_destroy(pool); - mps_thread_dereg(thread); - mps_arena_destroy(arena); -} - -int main(void) { - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/test/function/156.c b/mps/test/function/156.c deleted file mode 100644 index a5fc544fbfe..00000000000 --- a/mps/test/function/156.c +++ /dev/null @@ -1,58 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!156.c(trunk.2) $ - summary = EPDL fenceposting check: subfree - language = c - link = testlib.o -OUTPUT_SPEC - assert = true - assertfile P= dbgpool.c - assertcond = fencepost check on free -END_HEADER -*/ - -#include "testlib.h" -#include "mpscepdl.h" -#include "mpsavm.h" - - -void *stackpointer; -mps_arena_t arena; - -static mps_pool_debug_option_s debugOpts = {(void *)"bibblebo", 8}; - - -static void test(void) -{ - mps_thr_t thread; - mps_pool_t pool; - mps_addr_t a; - - cdie(mps_arena_create(&arena, mps_arena_class_vmnz(), - (size_t) (1024*1024*50)), "create arena"); - cdie(mps_thread_reg(&thread, arena), "register thread"); - - die( - mps_pool_create(&pool, arena, mps_class_epdl_debug(), &debugOpts, - 8192, 8, 8), - "create MVFF pool"); - - die(mps_alloc(&a, pool, 64), "alloc a"); - - mps_free(pool, a, 32); - - mps_pool_destroy(pool); - mps_thread_dereg(thread); - mps_arena_destroy(arena); -} - - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/test/function/157.c b/mps/test/function/157.c deleted file mode 100644 index 6f16a4be606..00000000000 --- a/mps/test/function/157.c +++ /dev/null @@ -1,57 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = EPDL fenceposting check: free - language = c - link = testlib.o -OUTPUT_SPEC - assert = true - assertcond = fencepost check on free -END_HEADER -*/ - -#include "testlib.h" -#include "mpscepdl.h" -#include "mpsavm.h" - -void *stackpointer; -mps_arena_t arena; - -static mps_pool_debug_option_s debugOpts = {(void *)"bibblebo", 8}; - -static void test(void) { - mps_thr_t thread; - mps_pool_t pool; - mps_addr_t a; - char * c; - - cdie(mps_arena_create(&arena, mps_arena_class_vmnz(), - (size_t) (1024*1024*50)), "create arena"); - cdie(mps_thread_reg(&thread, arena), "register thread"); - - die( - mps_pool_create(&pool, arena, mps_class_epdl_debug(), &debugOpts, - 8192, 8, 8), - "create MVFF pool"); - - die(mps_alloc(&a, pool, 63), "alloc a"); - - c = a; - c += 63; - *c = 0; - - mps_free(pool, a, 63); - - mps_pool_destroy(pool); - mps_thread_dereg(thread); - mps_arena_destroy(arena); -} - -int main(void) { - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/test/function/166.c b/mps/test/function/166.c deleted file mode 100644 index ae5cd04923b..00000000000 --- a/mps/test/function/166.c +++ /dev/null @@ -1,102 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!166.c(trunk.1) $ - summary = MVFF with AP split allocate from SW log (af_six) - language = c - link = testlib.o - stdin = af_six - harness = 2.0 - parameters = EXTEND=65536 AVGSIZE=32 ALIGN=8 \ - ARENAHIGH=1 SLOTHIGH=1 FIRST=1 SPLIT1=0 SPLIT2=0 -OUTPUT_SPEC - completed = yes -END_HEADER -*/ - -#include "testlib.h" -#include "mpscmvff.h" -#include "mpsavm.h" - -#define MAXOBJS (30000) - -mps_addr_t objs[MAXOBJS]; -size_t sizes[MAXOBJS]; - -void *stackpointer; -mps_arena_t arena; - -static void test(void) -{ - mps_thr_t thread; - mps_ap_t ap1, ap2, ap3, ap; - mps_pool_t pool1, pool2, pool3, pool; - log_event event; - int id; - char *c; - size_t size; - unsigned long maxcom; - mps_res_t res; - - maxcom = 0; - cdie(mps_arena_create(&arena, mps_arena_class_vmnz(), (size_t) (1024*1024*100)), - "create space"); - cdie(mps_thread_reg(&thread, arena), "register thread"); - - cdie(mps_pool_create(&pool1,arena,mps_class_mvff(), - EXTEND,AVGSIZE,ALIGN,ARENAHIGH,SLOTHIGH,FIRST), - "create pool1"); - cdie(mps_pool_create(&pool2,arena,mps_class_mvff(), - EXTEND,AVGSIZE,ALIGN,ARENAHIGH,SLOTHIGH,FIRST), - "create pool2"); - cdie(mps_pool_create(&pool3,arena,mps_class_mvff(), - EXTEND,AVGSIZE,ALIGN,ARENAHIGH,SLOTHIGH,FIRST), - "create pool3"); - cdie(mps_ap_create(&ap1,pool1), "ap 1"); - cdie(mps_ap_create(&ap2,pool2), "ap 2"); - cdie(mps_ap_create(&ap3,pool3), "ap 3"); - - - while (read_event(&event)) { - if (event.type == EVENT_ALLOC) { - id = event.alloc.id; - asserts(id < MAXOBJS, "MAXOBJS too small"); - size = ((event.alloc.size + ALIGN-1)|(ALIGN-1))^(ALIGN-1); - ap = (size < SPLIT1) ? ap1 : (size < SPLIT2) ? ap2 : ap3; - do { - MPS_RESERVE_BLOCK(res, objs[id], ap, size); - asserts(res == MPS_RES_OK, "alloc failed"); - } while (!mps_commit(ap, objs[id], size)); - sizes[id] = size; - c = objs[id]; - *c = 43; - } else if (event.type == EVENT_FREE) { - id = event.free.id; - size = sizes[id]; - pool = (size < SPLIT1) ? pool1 : (size < SPLIT2) ? pool2 : pool3; - mps_free(pool, objs[id], size); - } - size = mps_arena_committed(arena); - if (size > maxcom) maxcom=size; - } - report("maxcom", "%ld", maxcom); - - mps_ap_destroy(ap1); - mps_ap_destroy(ap2); - mps_ap_destroy(ap3); - mps_pool_destroy(pool1); - mps_pool_destroy(pool2); - mps_pool_destroy(pool3); - - mps_thread_dereg(thread); - mps_arena_destroy(arena); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/test/function/168.c b/mps/test/function/168.c deleted file mode 100644 index 87d1f59879f..00000000000 --- a/mps/test/function/168.c +++ /dev/null @@ -1,96 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!168.c(trunk.2) $ - summary = MVFF split allocate from SW log (af_six), with hysteresis control - language = c - link = testlib.o - stdin = af_six - parameters = EXTEND=65536 AVGSIZE=32 ALIGN=8 \ - ARENAHIGH=1 SLOTHIGH=1 FIRST=1 SPLIT1=0 SPLIT2=0 \ - COMMIT=30000000 SPARE=0 -OUTPUT_SPEC - result = pass -END_HEADER -*/ - -#include "testlib.h" -#include "mpscmvff.h" -#include "mpsavm.h" - -#define MAXOBJS (30000) - -mps_addr_t objs[MAXOBJS]; -size_t sizes[MAXOBJS]; - -void *stackpointer; -mps_arena_t arena; - -static void test(void) -{ - mps_thr_t thread; - mps_pool_t pool1, pool2, pool3, pool; - log_event event; - int id; - char *c; - size_t size; - unsigned long maxcom; - - maxcom = 0; - cdie(mps_arena_create(&arena, mps_arena_class_vmnz(), (size_t) (1024*1024*100)), - "create space"); - cdie(mps_thread_reg(&thread, arena), "register thread"); - - mps_arena_commit_limit_set(arena, COMMIT); - mps_arena_spare_commit_limit_set(arena, SPARE); - - cdie(mps_pool_create(&pool1,arena,mps_class_mvff(), - EXTEND,AVGSIZE,ALIGN,ARENAHIGH,SLOTHIGH,FIRST), - "create pool1"); - cdie(mps_pool_create(&pool2,arena,mps_class_mvff(), - EXTEND,AVGSIZE,ALIGN,ARENAHIGH,SLOTHIGH,FIRST), - "create pool2"); - cdie(mps_pool_create(&pool3,arena,mps_class_mvff(), - EXTEND,AVGSIZE,ALIGN,ARENAHIGH,SLOTHIGH,FIRST), - "create pool3"); - - while (read_event(&event)) { - if (event.type == EVENT_ALLOC) { - id = event.alloc.id; - asserts(id < MAXOBJS, "MAXOBJS too small"); - size = event.alloc.size; - pool = (size < SPLIT1) ? pool1 : (size < SPLIT2) ? pool2 : pool3; - die(mps_alloc(&objs[id], pool, size), "alloc"); -/* - comment("%d %ld %p", id, size, objs[id]); -*/ - sizes[id] = size; - c = objs[id]; - *c = 43; - } else if (event.type == EVENT_FREE) { - id = event.free.id; - size = sizes[id]; - pool = (size < SPLIT1) ? pool1 : (size < SPLIT2) ? pool2 : pool3; - mps_free(pool, objs[id], size); - } - size = mps_arena_committed(arena); - if (size > maxcom) maxcom=size; - } - report("maxcom", "%ld", maxcom); - - mps_pool_destroy(pool1); - mps_pool_destroy(pool2); - mps_pool_destroy(pool3); - - mps_thread_dereg(thread); - mps_arena_destroy(arena); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/test/function/169.c b/mps/test/function/169.c deleted file mode 100644 index e0141f53830..00000000000 --- a/mps/test/function/169.c +++ /dev/null @@ -1,92 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!154.c(trunk.1) $ - summary = EPVM allocate smaller segment when big one doesn't fit - language = c - link = testlib.o epvmfmt.o - harness = 2.0 - parameters = RAISE=16384 -END_HEADER -*/ - -#include "testlib.h" -#include "mpscepvm.h" -#include "mpsavm.h" -#include "epvmfmt.h" - -#define MAX_SAVE 1000 -#define INIT_SAVE 12 - -void *stackpointer; - -static void test(void) -{ - mps_arena_t arena; - mps_thr_t thread; - - mps_fmt_t format; - - mps_pool_t pool1; - mps_ap_t ap1s; - - int j; - - psobj *a; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), (size_t) (1024*1024*64)), - "create arena"); - - cdie(mps_thread_reg(&thread, arena), "register thread"); - - cdie(mps_fmt_create_A(&format, arena, &fmtepvm), "create format"); - - cdie(mps_pool_create(&pool1, arena, mps_class_epvm(), - format, MAX_SAVE, INIT_SAVE), "create pool1"); - - cdie(mps_ap_create(&ap1s, pool1, 0), "create ap1s"); - - /* allocate a bit to get us off the initial segment */ - - for (j=0; j<1024; j++) { - a = allocepvm(ap1s, 32); - } - - comment("initial allocation"); - - /* set commit limit to allow no more */ - - cdie(mps_arena_commit_limit_set(arena, mps_arena_committed(arena)), - "commit limit set"); - - /* and allocate 4KB objects until full */ - while(allocrepvm(&a, ap1s, 4096/8) == MPS_RES_OK) {}; - - /* raise commit limit by RAISE (default is 16KB) */ - - cdie(mps_arena_commit_limit_set(arena, mps_arena_committed(arena)+RAISE), - "commit limit raise"); - - /* and try to allocate one more object */ - - a = allocepvm(ap1s, 4096/8); - - mps_ap_destroy(ap1s); - mps_pool_destroy(pool1); - mps_fmt_destroy(format); - mps_thread_dereg(thread); - mps_arena_destroy(arena); - comment("Destroyed arena"); - -} - -int main(void) { - void *m; - stackpointer=&m; - - easy_tramp(test); - pass(); - return 0; -} - - - diff --git a/mps/test/function/172.c b/mps/test/function/172.c deleted file mode 100644 index d56a029ce3b..00000000000 --- a/mps/test/function/172.c +++ /dev/null @@ -1,68 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = Intern and Label telemetry events - language = c - link = testlib.o - stdin = af_six -OUTPUT_SPEC - result = pass -END_HEADER -*/ - -#include "testlib.h" -#include "mpscmv.h" -#include "mpsavm.h" - -void *stackpointer; -mps_arena_t arena; - -static void test(void) -{ - mps_thr_t thread; - mps_pool_t pool; - mps_addr_t a; - int i; - - char str[] = " 0 MMQA interned symbol\t212 œ%)(*œ!)( "; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), (size_t) (1024*1024*10)), - "create space"); - - (void) mps_telemetry_control(0x7F, 0x7F); - - cdie(mps_thread_reg(&thread, arena), "register thread"); - - cdie(mps_pool_create(&pool,arena,mps_class_mv(), 65536, 32, 65536), - "create pool"); - - mps_telemetry_label(NULL, mps_telemetry_intern("FOO")); - - for (i = 0; i < 20; i++) { - die(mps_alloc(&a, pool, 64), "alloc"); - } - - for (i = 0; i < 10; i++) { - die(mps_alloc(&a, pool, 128), "alloc"); - mps_telemetry_label(a, mps_telemetry_intern(str)); - str[1]++; - } - - for (i = 0; i < 20; i++) { - die(mps_alloc(&a, pool, 64), "alloc"); - } - - mps_pool_destroy(pool); - mps_thread_dereg(thread); - mps_arena_destroy(arena); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/test/function/173.c b/mps/test/function/173.c deleted file mode 100644 index 000fd81dd6a..00000000000 --- a/mps/test/function/173.c +++ /dev/null @@ -1,79 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - harness = 3.0 - summary = Get the last page in a chunk into the hysteresis fund - language = c - link = testlib.o - parameters = CHUNK_SIZE=(1024*1024) OBJ_FROM=(1024*1024*2) \ - OBJ_TO=(1024*1024*3) -OUTPUT_SPEC - completed = yes -END_HEADER -*/ - -/* This test was written to provoke the assertion in - request.epcore.160256 (Assertion failure while purging the - hysteresis fund.) - - drj suggested that the assertion would be provoked if we - arranged for an arena chunk to have less than one whole - page description on the last page occupied by the page table, - arranged for the page corresponding to this page description - to be in the hysteresis fund, and then purged the fund. - - This test attempts to cause this situation by creating an arena - with a small chunk size, allocating an object that's bigger - than the chunk size (hence causing a new chunk to be created), - freeing it, then destroying the arena again. We repeat with - different object sizes, until (we hope) eventually there is - only a partial page descriptor in the last page occupied by - the page table. - - We use an EPDR pool to increase the chance of the object covering - the last page (but it's a VM arena so we can't be sure what zones - will be used). Of course, the test is sensitive to the algorithm - by which the arena decides how big to make the new chunk. -*/ - -#include "testlib.h" -#include "mpsavm.h" -#include "mpscepdl.h" - -mps_arena_t arena; -mps_thr_t thread; -mps_root_t root; - -static void test(void) -{ - mps_pool_t pool; - mps_addr_t a; - size_t objsize; - - for (objsize = OBJ_FROM; objsize < OBJ_TO; objsize += 4096) { - - report("objsize", "%d", objsize); - - die(mps_arena_create(&arena, mps_arena_class_vm(), (size_t) CHUNK_SIZE), - "create arena with 1MB chunk size"); - die(mps_thread_reg(&thread, arena), "register thread"); - die(mps_pool_create(&pool, arena, mps_class_epdr(), 65536, 32, 8), - "create EPDR pool"); - - mps_arena_spare_commit_limit_set(arena, (size_t) OBJ_TO); - - die(mps_alloc(&a, pool, objsize), "alloc"); - mps_free(pool, a, objsize); - - mps_pool_destroy(pool); - mps_thread_dereg(thread); - mps_arena_destroy(arena); - } -} - -int main(void) -{ - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/test/function/174.c b/mps/test/function/174.c deleted file mode 100644 index c4dce0728b7..00000000000 --- a/mps/test/function/174.c +++ /dev/null @@ -1,89 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = MV SAC allocate from SW log (af_six) - language = c - link = testlib.o - stdin = af_six - parameters = EXTEND=65536 AVGSIZE=32 MAXSIZE=256*1024 \ - SPLIT1=128 COUNT1=64 FREQ1=1 SPLIT2=1024 COUNT2=64 FREQ2=2 -OUTPUT_SPEC - result = pass -END_HEADER -*/ - -#include "testlib.h" -#include "mpscmv.h" -#include "mpsavm.h" - -#define MAXOBJS (30000) - -mps_addr_t objs[MAXOBJS]; -size_t sizes[MAXOBJS]; - -void *stackpointer; -mps_arena_t arena; - -static void test(void) -{ - mps_thr_t thread; - mps_pool_t pool; - mps_sac_t sac; - log_event event; - int id; - char *c; - size_t size; - unsigned long maxcom; - mps_res_t res; - - struct mps_sac_classes_s sac_classes[] = { - { SPLIT1, COUNT1, FREQ1 }, - { SPLIT2, COUNT2, FREQ2 } - }; - - maxcom = 0; - cdie(mps_arena_create(&arena, mps_arena_class_vmnz(), (size_t) (1024*1024*100)), - "create space"); - cdie(mps_thread_reg(&thread, arena), "register thread"); - - cdie(mps_pool_create(&pool,arena,mps_class_mv(),EXTEND,AVGSIZE,MAXSIZE), - "create pool"); - - cdie(mps_sac_create(&sac, pool, 2, sac_classes), "sac create"); - - while (read_event(&event)) { - if (event.type == EVENT_ALLOC) { - id = event.alloc.id; - asserts(id < MAXOBJS, "MAXOBJS too small"); - size = event.alloc.size; - MPS_SAC_ALLOC(res, objs[id], sac, size, 0); - asserts(res == MPS_RES_OK, "alloc"); - sizes[id] = size; - c = objs[id]; - *c = 43; - } else if (event.type == EVENT_FREE) { - id = event.free.id; - size = sizes[id]; - MPS_SAC_FREE(sac, objs[id], size); - } - size = mps_arena_committed(arena); - if (size > maxcom) maxcom=size; - } - report("maxcom", "%ld", maxcom); - - mps_sac_destroy(sac); - mps_pool_destroy(pool); - - mps_thread_dereg(thread); - mps_arena_destroy(arena); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/test/function/175.c b/mps/test/function/175.c deleted file mode 100644 index 4ba64427fac..00000000000 --- a/mps/test/function/175.c +++ /dev/null @@ -1,65 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - harness = 2.2 - summary = MV SAC create alloc free destroy - language = c - link = testlib.o - stdin = af_six - parameters = ITERATIONS=30000 OBJSIZE=1024*1024 EXTEND=65536 AVGSIZE=32 MAXSIZE=65536 -OUTPUT_SPEC - completed = yes -END_HEADER -*/ - -#include "testlib.h" -#include "mpscmv.h" -#include "mpsavm.h" - -void *stackpointer; -mps_arena_t arena; - -static void test(void) -{ - mps_thr_t thread; - mps_pool_t pool; - mps_sac_t sac; - mps_res_t res; - void *p; - int i; - - struct mps_sac_classes_s sac_classes[] = { - { OBJSIZE, 30, 10 }, - }; - - cdie(mps_arena_create(&arena, mps_arena_class_vmnz(), (size_t) (1024*1024*100)), - "create space"); - cdie(mps_thread_reg(&thread, arena), "register thread"); - - cdie(mps_pool_create(&pool,arena,mps_class_mv(),EXTEND,AVGSIZE,MAXSIZE), - "create pool"); - - for (i = 0; i < ITERATIONS; i++) { - if (i % 1000 == 0) comment("%d", i); - die(mps_sac_create(&sac, pool, 1, sac_classes), "sac create"); - MPS_SAC_ALLOC(res, p, sac, OBJSIZE, 0); - asserts(res == MPS_RES_OK, "alloc failed"); - MPS_SAC_FREE(sac, p, OBJSIZE); - mps_sac_destroy(sac); - } - - mps_pool_destroy(pool); - - mps_thread_dereg(thread); - mps_arena_destroy(arena); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/test/function/201.c b/mps/test/function/201.c deleted file mode 100644 index 1872aa30b43..00000000000 --- a/mps/test/function/201.c +++ /dev/null @@ -1,176 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = new EPDL allocation test - language = c - link = testlib.o -END_HEADER -*/ - -#include -#include "testlib.h" -#include "mpscepdl.h" -#include "mpsavm.h" - -#define MAXNUMBER 1000000 - -void *stackpointer; -mps_space_t space; - -static struct {mps_addr_t addr; size_t size;} queue[MAXNUMBER]; - -enum {SEQ=0, RAN=1, SEQGAP=2, RANGAP=3, DUMMY=4}; -static char *tdesc[] = {"sequential", "random", - "sequential gap", "random gap", "dummy"}; - -static void setobj(mps_addr_t a, size_t size, unsigned char val) -{ - unsigned char *b; - b = a; - - while (size>0) - { - *b=val; - /* comment("%p = %i", b, (int) val); - */ - b++; - size--; - } -} - -static int chkobj(mps_addr_t a, size_t size, unsigned char val) -{ - unsigned char *b; - b = a; - - while (size>0) - { - /* comment("%p == %i", b, (int) val); - */ - if (*b != val) return 0; - b++; - size--; - } - return 1; -} - -static void dt(int kind, - size_t extendBy, size_t avgSize, size_t align, - size_t mins, size_t maxs, int number, int iter) -{ - mps_pool_t pool; - int i, hd; - clock_t time0, time1; - size_t size; - int secs; - - asserts(number <= MAXNUMBER, "number too big"); - - time0 = clock(); - asserts(time0 != -1, "processor time not available"); - - die( - mps_pool_create(&pool, space, mps_class_epdl(), - extendBy, avgSize, align), - "create EPDL pool"); - - for(hd=0; hd -#include "testlib.h" -#include "mpscepdl.h" -#include "mpsavm.h" - -#define MAXNUMBER 1000000 - -void *stackpointer; -mps_space_t space; - -static struct {mps_addr_t addr; size_t size;} queue[MAXNUMBER]; - -enum {SEQ=0, RAN=1, SEQGAP=2, RANGAP=3, DUMMY=4}; -static char *tdesc[] = {"sequential", "random", - "sequential gap", "random gap", "dummy"}; - -static void setobj(mps_addr_t a, size_t size, unsigned char val) -{ - unsigned char *b; - b = a; - - while (size>0) - { - *b=val; - /* comment("%p = %i", b, (int) val); - */ - b++; - size--; - } -} - -static int chkobj(mps_addr_t a, size_t size, unsigned char val) -{ - unsigned char *b; - b = a; - - while (size>0) - { - /* comment("%p == %i", b, (int) val); - */ - if (*b != val) return 0; - b++; - size--; - } - return 1; -} - -static void dt(int kind, - size_t extendBy, size_t avgSize, size_t align, - size_t mins, size_t maxs, int number, int iter) -{ - mps_pool_t pool; - int i, hd; - clock_t time0, time1; - size_t size; - int secs; - - asserts(number <= MAXNUMBER, "number too big"); - - time0 = clock(); - asserts(time0 != -1, "processor time not available"); - - die( - mps_pool_create(&pool, space, mps_class_epdr(), - extendBy, avgSize, align), - "create EPDR pool"); - - for(hd=0; hd maxcom) maxcom = size; - } - - report("maxcom", "%ld", maxcom); - - mps_pool_destroy(pool); - - mps_thread_dereg(thread); - mps_arena_destroy(arena); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/test/function/211.c b/mps/test/function/211.c deleted file mode 100644 index e8945a06c56..00000000000 --- a/mps/test/function/211.c +++ /dev/null @@ -1,77 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = MVFF allocate from SW log (af_six) - language = c - link = testlib.o - stdin = af_six -OUTPUT_SPEC - result = pass -END_HEADER -*/ - -#include "testlib.h" -#include "mpscmvff.h" -#include "mpsavm.h" - -#define MAXOBJS (30000) - -mps_addr_t objs[MAXOBJS]; -size_t sizes[MAXOBJS]; - -void *stackpointer; -mps_arena_t arena; - -static void test(void) -{ - mps_thr_t thread; - mps_pool_t pool; - log_event event; - int id; - char *c; - size_t size; - unsigned long maxcom; - - maxcom = 0; - cdie(mps_arena_create(&arena, mps_arena_class_vm(), (size_t) (1024*1024*100)), - "create space"); - cdie(mps_thread_reg(&thread, arena), "register thread"); - - cdie( - mps_pool_create(&pool, arena, mps_class_mvff(), - 8192, 32, 8, 1, 1, 0), - "create EPDR pool"); - - while (read_event(&event)) { - if (event.type == EVENT_ALLOC) { - id = event.alloc.id; - asserts(id < MAXOBJS, "MAXOBJS too small"); - size = event.alloc.size; - die(mps_alloc(&objs[id], pool, size), "alloc"); - sizes[id] = size; - c = objs[id]; - *c = 43; - } else if (event.type == EVENT_FREE) { - id = event.free.id; - mps_free(pool, objs[id], sizes[id]); - } - size = mps_arena_committed(arena); - if (size > maxcom) maxcom=size; - } - report("maxcom", "%ld", maxcom); - - mps_pool_destroy(pool); - - mps_thread_dereg(thread); - mps_arena_destroy(arena); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/test/function/212.c b/mps/test/function/212.c deleted file mode 100644 index a1345fb0e79..00000000000 --- a/mps/test/function/212.c +++ /dev/null @@ -1,92 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = MV2 allocate from SW log (af_six) - language = c - link = testlib.o - stdin = af_six -OUTPUT_SPEC - result = pass -END_HEADER -*/ - -#include "testlib.h" -#include "mpscmv2.h" -#include "mpsavm.h" - -#define MAXOBJS (30000) - -#define MINSIZE 8 -#define AVGSIZE 128 -#define MAXSIZE 8192 -#define DEPTH 10 -#define FRAGLIMIT 100 - -mps_addr_t objs[MAXOBJS]; -size_t sizes[MAXOBJS]; - -void *stackpointer; -mps_arena_t arena; - -static void test(void) -{ - mps_thr_t thread; - mps_pool_t pool; - mps_ap_t ap; - log_event event; - int id; - char *c; - size_t size; - unsigned long maxcom; - mps_res_t res; - - maxcom = 0; - cdie(mps_arena_create(&arena, mps_arena_class_vm(), (size_t) (1024*1024*100)), - "create space"); - cdie(mps_thread_reg(&thread, arena), "register thread"); - - cdie( - mps_pool_create(&pool, arena, mps_class_mv2(), - MINSIZE, AVGSIZE, MAXSIZE, DEPTH, FRAGLIMIT), - "create MV2 pool"); - - cdie(mps_ap_create(&ap, pool, MPS_RANK_AMBIG), "create ap"); - - while (read_event(&event)) { - if (event.type == EVENT_ALLOC) { - id = event.alloc.id; - asserts(id < MAXOBJS, "MAXOBJS too small"); - size = event.alloc.size; - sizes[id] = size; - size = ((size+7)/8)*8; - do { - MPS_RESERVE_BLOCK(res, objs[id], ap, size); - asserts(res == MPS_RES_OK, "alloc failed"); - } while (!mps_commit(ap, objs[id], size)); - - c = objs[id]; - *c = 43; - } else if (event.type == EVENT_FREE) { - id = event.free.id; - mps_free(pool, objs[id], sizes[id]); - } - size = mps_arena_committed(arena); - if (size > maxcom) maxcom=size; - } - report("maxcom", "%ld", maxcom); - - mps_pool_destroy(pool); - - mps_thread_dereg(thread); - mps_arena_destroy(arena); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/test/function/213.c b/mps/test/function/213.c deleted file mode 100644 index 4d118465a79..00000000000 --- a/mps/test/function/213.c +++ /dev/null @@ -1,87 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = MV2 allocate from SW log (af_six) - language = c - link = testlib.o - stdin = af_six - parameters = MINSIZE AVGSIZE MAXSIZE DEPTH FRAGLIMIT -OUTPUT_SPEC - result = pass -END_HEADER -*/ - -#include "testlib.h" -#include "mpscmv2.h" -#include "mpsavm.h" - -#define MAXOBJS (30000) - -mps_addr_t objs[MAXOBJS]; -size_t sizes[MAXOBJS]; - -void *stackpointer; -mps_arena_t arena; - -static void test(void) -{ - mps_thr_t thread; - mps_pool_t pool; - mps_ap_t ap; - log_event event; - int id; - char *c; - size_t size; - unsigned long maxcom; - mps_res_t res; - - maxcom = 0; - cdie(mps_arena_create(&arena, mps_arena_class_vm(), (size_t) (1024*1024*100)), - "create space"); - cdie(mps_thread_reg(&thread, arena), "register thread"); - - cdie( - mps_pool_create(&pool, arena, mps_class_mv2(), - MINSIZE, AVGSIZE, MAXSIZE, DEPTH, FRAGLIMIT), - "create MV2 pool"); - - cdie(mps_ap_create(&ap, pool, MPS_RANK_AMBIG), "create ap"); - - while (read_event(&event)) { - if (event.type == EVENT_ALLOC) { - id = event.alloc.id; - asserts(id < MAXOBJS, "MAXOBJS too small"); - size = event.alloc.size; - sizes[id] = size; - size = ((size+7)/8)*8; - do { - MPS_RESERVE_BLOCK(res, objs[id], ap, size); - asserts(res == MPS_RES_OK, "alloc failed"); - } while (!mps_commit(ap, objs[id], size)); - - c = objs[id]; - *c = 43; - } else if (event.type == EVENT_FREE) { - id = event.free.id; - mps_free(pool, objs[id], sizes[id]); - } - size = mps_arena_committed(arena); - if (size > maxcom) maxcom=size; - } - report("maxcom", "%ld", maxcom); - - mps_pool_destroy(pool); - - mps_thread_dereg(thread); - mps_arena_destroy(arena); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/test/function/216.c b/mps/test/function/216.c deleted file mode 100644 index 8d116567788..00000000000 --- a/mps/test/function/216.c +++ /dev/null @@ -1,112 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = MV2 from af_six measuring fragmentation - language = c - link = testlib.o - stdin = af_six - parameters = MINSIZE=8 AVGSIZE=128 MAXSIZE=65536 DEPTH FRAGLIMIT -OUTPUT_SPEC - result = pass -END_HEADER -*/ - -#include "testlib.h" -#include "mpscmv2.h" -#include "mpsavm.h" - -#define MAXOBJS (30000) - -mps_addr_t objs[MAXOBJS]; -size_t sizes[MAXOBJS]; -size_t total_size; -size_t committed; -int fragmentation; - -double fragacc; -double commacc; -double sizeacc; -double count; - -void *stackpointer; -mps_arena_t arena; - -static void test(void) -{ - mps_thr_t thread; - mps_pool_t pool; - mps_ap_t ap; - log_event event; - int id; - char *c; - size_t size; - unsigned long maxcom; - mps_res_t res; - - maxcom = 0; - fragacc = 0; - commacc = 0; - sizeacc = 0; - count = 0; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), (size_t) (1024*1024*100)), - "create space"); - cdie(mps_thread_reg(&thread, arena), "register thread"); - - cdie( - mps_pool_create(&pool, arena, mps_class_mv2(), - MINSIZE, AVGSIZE, MAXSIZE, DEPTH, FRAGLIMIT), - "create MV2 pool"); - - cdie(mps_ap_create(&ap, pool, MPS_RANK_AMBIG), "create ap"); - - committed = mps_arena_committed(arena); - - while (read_event(&event)) { - if (event.type == EVENT_ALLOC) { - id = event.alloc.id; - asserts(id < MAXOBJS, "MAXOBJS too small"); - size = event.alloc.size; - sizes[id] = size; - size = ((size+7)/8)*8; - do { - MPS_RESERVE_BLOCK(res, objs[id], ap, size); - asserts(res == MPS_RES_OK, "alloc failed"); - } while (!mps_commit(ap, objs[id], size)); - total_size+=sizes[id]; - c = objs[id]; - *c = 43; - } else if (event.type == EVENT_FREE) { - id = event.free.id; - mps_free(pool, objs[id], sizes[id]); - total_size-=sizes[id]; - } - committed = mps_arena_committed(arena); - if (committed > maxcom) maxcom=committed; - fragacc += ((double) (committed-total_size))/((double) committed); - commacc += (double) committed; - sizeacc += (double) total_size; - count += 1; - } - report("maxcom", "%ld", maxcom); - report("fragavg", "%f", fragacc/count); - report("fragweighted", "%f", (commacc-sizeacc)/commacc); - report("commavg", "%f", commacc/count); - report("sizeavg", "%f", sizeacc/count); - - mps_ap_destroy(ap); - mps_pool_destroy(pool); - - mps_thread_dereg(thread); - mps_arena_destroy(arena); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/test/function/217.c b/mps/test/function/217.c deleted file mode 100644 index 01c3ec50b3f..00000000000 --- a/mps/test/function/217.c +++ /dev/null @@ -1,95 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = MVFF allocate from SW log (af_six) - language = c - link = testlib.o - stdin = af_six - parameters = EXTENDBY=65536 AVGSIZE=128 ALIGN=8 ARENAHIGH=1 SLOTHIGH=1 FIRST=1 -OUTPUT_SPEC - result = pass -END_HEADER -*/ - -#include "testlib.h" -#include "mpscmvff.h" -#include "mpsavm.h" - -#define MAXOBJS (30000) - -mps_addr_t objs[MAXOBJS]; -size_t sizes[MAXOBJS]; -size_t total_size; -size_t committed; -int fragmentation; -int lastfrag=0; - -void *stackpointer; -mps_arena_t arena; - -static void test(void) -{ - mps_thr_t thread; - mps_pool_t pool; - log_event event; - int id; - char *c; - size_t size; - unsigned long maxcom; - - maxcom = 0; - cdie(mps_arena_create(&arena, mps_arena_class_vm(), (size_t) (1024*1024*100)), - "create space"); - cdie(mps_thread_reg(&thread, arena), "register thread"); - - cdie( - mps_pool_create(&pool, arena, mps_class_mvff(), - EXTENDBY, AVGSIZE, ALIGN, ARENAHIGH, SLOTHIGH, FIRST), - "create MVFF pool"); - - committed = mps_arena_committed(arena); - - while (read_event(&event)) { - if (event.type == EVENT_ALLOC) { - id = event.alloc.id; - asserts(id < MAXOBJS, "MAXOBJS too small"); - size = event.alloc.size; - sizes[id] = size; - size = ((size+7)/8)*8; - die(mps_alloc(&objs[id], pool, size), "alloc"); - - if (mps_arena_committed(arena) > committed) { - fragmentation = (100*(committed-total_size)/committed); - if (fragmentation != lastfrag) { - lastfrag = fragmentation; - report("fragmentation", "%d", fragmentation); - } - } - total_size+=sizes[id]; - c = objs[id]; - *c = 43; - } else if (event.type == EVENT_FREE) { - id = event.free.id; - mps_free(pool, objs[id], sizes[id]); - total_size-=sizes[id]; - } - committed = mps_arena_committed(arena); - if (committed > maxcom) maxcom=committed; - } - report("maxcom", "%ld", maxcom); - - mps_pool_destroy(pool); - - mps_thread_dereg(thread); - mps_arena_destroy(arena); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/test/function/218.c b/mps/test/function/218.c deleted file mode 100644 index 40a9948bbfa..00000000000 --- a/mps/test/function/218.c +++ /dev/null @@ -1,103 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = EPDR from af_six measuring fragmentation - language = c - link = testlib.o - stdin = af_six - parameters = ALIGN=8 AVGSIZE=128 EXTENDBY=65536 -OUTPUT_SPEC - result = pass -END_HEADER -*/ - -#include "testlib.h" -#include "mpscepdl.h" -#include "mpsavm.h" - -#define MAXOBJS (30000) - -mps_addr_t objs[MAXOBJS]; -size_t sizes[MAXOBJS]; -size_t total_size; -size_t committed; -int fragmentation; - -double fragacc; -double commacc; -double sizeacc; -double count; - -void *stackpointer; -mps_arena_t arena; - -static void test(void) -{ - mps_thr_t thread; - mps_pool_t pool; - log_event event; - int id; - char *c; - size_t size; - unsigned long maxcom; - - maxcom = 0; - fragacc = 0; - commacc = 0; - sizeacc = 0; - count = 0; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), (size_t) (1024*1024*100)), - "create space"); - cdie(mps_thread_reg(&thread, arena), "register thread"); - - cdie( - mps_pool_create(&pool, arena, mps_class_epdr(), - EXTENDBY, AVGSIZE, ALIGN), - "create EPDR pool"); - - committed = mps_arena_committed(arena); - - while (read_event(&event)) { - if (event.type == EVENT_ALLOC) { - id = event.alloc.id; - asserts(id < MAXOBJS, "MAXOBJS too small"); - size = event.alloc.size; - sizes[id] = size; - mps_alloc(&objs[id], pool, size); - total_size+=sizes[id]; - c = objs[id]; - *c = 43; - } else if (event.type == EVENT_FREE) { - id = event.free.id; - mps_free(pool, objs[id], sizes[id]); - total_size-=sizes[id]; - } - committed = mps_arena_committed(arena); - if (committed > maxcom) maxcom=committed; - fragacc += ((double) (committed-total_size))/((double) committed); - commacc += (double) committed; - sizeacc += (double) total_size; - count += 1; - } - report("maxcom", "%ld", maxcom); - report("fragavg", "%f", fragacc/count); - report("fragweighted", "%f", (commacc-sizeacc)/commacc); - report("commavg", "%f", commacc/count); - report("sizeavg", "%f", sizeacc/count); - - mps_pool_destroy(pool); - - mps_thread_dereg(thread); - mps_arena_destroy(arena); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/test/function/219.c b/mps/test/function/219.c deleted file mode 100644 index 60655814cd7..00000000000 --- a/mps/test/function/219.c +++ /dev/null @@ -1,118 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = MV2 from af_six measuring fragmentation - language = c - link = testlib.o - stdin = af_six - parameters = COMLIMIT=(1024*1024*100) MINSIZE=8 AVGSIZE=1024 MAXSIZE=65536 LIMIT FRAGLIMIT -OUTPUT_SPEC - result = pass -END_HEADER -*/ - -#include "testlib.h" -#include "mpscmv2.h" -#include "mpsavm.h" - -#define MAXOBJS (30000) - -mps_addr_t objs[MAXOBJS]; -size_t sizes[MAXOBJS]; -size_t total_size; -size_t committed; -int fragmentation; - -double fragacc; -double commacc; -double sizeacc; -double count; - -void *stackpointer; -mps_arena_t arena; - -static void test(void) -{ - mps_thr_t thread; - mps_pool_t pool; - mps_ap_t ap; - log_event event; - int id; - char *c; - size_t size; - unsigned long maxcom; - unsigned long depth; - mps_res_t res; - - maxcom = 0; - fragacc = 0; - commacc = 0; - sizeacc = 0; - count = 0; - depth = LIMIT*2*(MAXSIZE/AVGSIZE)*(100/FRAGLIMIT); - report("depth", "%ld", depth); - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), (size_t) (1024*1024*100)), - "create space"); - cdie(mps_arena_commit_limit_set(arena, COMLIMIT), "commit limit"); - cdie(mps_thread_reg(&thread, arena), "register thread"); - - cdie( - mps_pool_create(&pool, arena, mps_class_mv2(), - MINSIZE, AVGSIZE, MAXSIZE, - depth, - FRAGLIMIT), - "create MV2 pool"); - - cdie(mps_ap_create(&ap, pool, MPS_RANK_AMBIG), "create ap"); - - committed = mps_arena_committed(arena); - - while (read_event(&event)) { - if (event.type == EVENT_ALLOC) { - id = event.alloc.id; - asserts(id < MAXOBJS, "MAXOBJS too small"); - size = event.alloc.size; - sizes[id] = size; - size = ((size+7)/8)*8; - do { - MPS_RESERVE_BLOCK(res, objs[id], ap, size); - asserts(res == MPS_RES_OK, "alloc failed"); - } while (!mps_commit(ap, objs[id], size)); - total_size+=sizes[id]; - c = objs[id]; - *c = 43; - } else if (event.type == EVENT_FREE) { - id = event.free.id; - mps_free(pool, objs[id], sizes[id]); - total_size-=sizes[id]; - } - committed = mps_arena_committed(arena); - if (committed > maxcom) maxcom=committed; - fragacc += ((double) (committed-total_size))/((double) committed); - commacc += (double) committed; - sizeacc += (double) total_size; - count += 1; - } - report("maxcom", "%ld", maxcom); - report("fragavg", "%f", fragacc/count); - report("fragweighted", "%f", (commacc-sizeacc)/commacc); - report("commavg", "%f", commacc/count); - report("sizeavg", "%f", sizeacc/count); - - mps_ap_destroy(ap); - mps_pool_destroy(pool); - - mps_thread_dereg(thread); - mps_arena_destroy(arena); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/test/function/220.c b/mps/test/function/220.c deleted file mode 100644 index 814e9e0244a..00000000000 --- a/mps/test/function/220.c +++ /dev/null @@ -1,103 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = MVFF from af_six measuring fragmentation - language = c - link = testlib.o - stdin = af_six - parameters = ALIGN=8 AVGSIZE=128 EXTENDBY=65536 ARENAHIGH SLOTHIGH FIRSTFIT -OUTPUT_SPEC - result = pass -END_HEADER -*/ - -#include "testlib.h" -#include "mpscmvff.h" -#include "mpsavm.h" - -#define MAXOBJS (30000) - -mps_addr_t objs[MAXOBJS]; -size_t sizes[MAXOBJS]; -size_t total_size; -size_t committed; -int fragmentation; - -double fragacc; -double commacc; -double sizeacc; -double count; - -void *stackpointer; -mps_arena_t arena; - -static void test(void) -{ - mps_thr_t thread; - mps_pool_t pool; - log_event event; - int id; - char *c; - size_t size; - unsigned long maxcom; - - maxcom = 0; - fragacc = 0; - commacc = 0; - sizeacc = 0; - count = 0; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), (size_t) (1024*1024*100)), - "create space"); - cdie(mps_thread_reg(&thread, arena), "register thread"); - - cdie( - mps_pool_create(&pool, arena, mps_class_mvff(), - EXTENDBY, AVGSIZE, ALIGN, ARENAHIGH, SLOTHIGH, FIRSTFIT), - "create MVFF pool"); - - committed = mps_arena_committed(arena); - - while (read_event(&event)) { - if (event.type == EVENT_ALLOC) { - id = event.alloc.id; - asserts(id < MAXOBJS, "MAXOBJS too small"); - size = event.alloc.size; - sizes[id] = size; - mps_alloc(&objs[id], pool, size); - total_size+=sizes[id]; - c = objs[id]; - *c = 43; - } else if (event.type == EVENT_FREE) { - id = event.free.id; - mps_free(pool, objs[id], sizes[id]); - total_size-=sizes[id]; - } - committed = mps_arena_committed(arena); - if (committed > maxcom) maxcom=committed; - fragacc += ((double) (committed-total_size))/((double) committed); - commacc += (double) committed; - sizeacc += (double) total_size; - count += 1; - } - report("maxcom", "%ld", maxcom); - report("fragavg", "%f", fragacc/count); - report("fragweighted", "%f", (commacc-sizeacc)/commacc); - report("commavg", "%f", commacc/count); - report("sizeavg", "%f", sizeacc/count); - - mps_pool_destroy(pool); - - mps_thread_dereg(thread); - mps_arena_destroy(arena); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/test/function/221.c b/mps/test/function/221.c deleted file mode 100644 index 8a5679e7d7e..00000000000 --- a/mps/test/function/221.c +++ /dev/null @@ -1,162 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = MV2*3 from af_six measuring fragmentation - language = c - link = testlib.o - stdin = af_six - parameters = COMLIMIT=(1024*1024*100) MIN1=8 MIN2=256 MIN3=4096 MAX3=32768 LIMIT FRAGLIMIT -OUTPUT_SPEC - result = pass -END_HEADER -*/ - -#include "testlib.h" -#include "mpscmv2.h" -#include "mpsavm.h" - -#define MAXOBJS (30000) - -mps_addr_t objs[MAXOBJS]; -size_t sizes[MAXOBJS]; -mps_pool_t pools[MAXOBJS]; -size_t total_size; -size_t committed; -int fragmentation; - -double fragacc; -double commacc; -double sizeacc; -double count; - -void *stackpointer; -mps_arena_t arena; - -static void test(void) -{ - mps_thr_t thread; - mps_pool_t pool1, pool2, pool3; - mps_ap_t ap1, ap2, ap3, ap; - log_event event; - int id; - char *c; - size_t size; - unsigned long maxcom; - unsigned long depth1, depth2, depth3; - size_t avg1, avg2, avg3; - mps_res_t res; - - maxcom = 0; - fragacc = 0; - commacc = 0; - sizeacc = 0; - count = 0; - - avg1 = MIN1; - avg2 = MIN2; - avg3 = MIN3; - - depth1 = LIMIT*2*(MIN2/avg1)*(100/FRAGLIMIT); - depth2 = LIMIT*2*(MIN3/avg2)*(100/FRAGLIMIT); - depth3 = LIMIT*2*(MAX3/avg3)*(100/FRAGLIMIT); - - report("avg1", "%ld", avg1); - report("depth1", "%ld", depth1); - report("avg2", "%ld", avg2); - report("depth2", "%ld", depth2); - report("avg3", "%ld", avg3); - report("depth3", "%ld", depth3); - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), (size_t) (1024*1024*100)), - "create space"); - cdie(mps_arena_commit_limit_set(arena, COMLIMIT), "commit limit"); - cdie(mps_thread_reg(&thread, arena), "register thread"); - - cdie( - mps_pool_create(&pool1, arena, mps_class_mv2(), - MIN1, avg1, MIN2, - depth1, - FRAGLIMIT), - "create MV2 pool (small)"); - cdie(mps_ap_create(&ap1, pool1, MPS_RANK_AMBIG), "create ap (small)"); - - cdie( - mps_pool_create(&pool2, arena, mps_class_mv2(), - MIN2, avg2, MIN3, - depth2, - FRAGLIMIT), - "create MV2 pool (medium)"); - cdie(mps_ap_create(&ap2, pool2, MPS_RANK_AMBIG), "create ap (medium)"); - - cdie( - mps_pool_create(&pool3, arena, mps_class_mv2(), - MIN3, avg3, MAX3, - depth3, - FRAGLIMIT), - "create MV2 pool (big)"); - cdie(mps_ap_create(&ap3, pool3, MPS_RANK_AMBIG), "create ap (big)"); - - committed = mps_arena_committed(arena); - - while (read_event(&event)) { - if (event.type == EVENT_ALLOC) { - id = event.alloc.id; - asserts(id < MAXOBJS, "MAXOBJS too small"); - size = event.alloc.size; - sizes[id] = size; - size = ((size+7)/8)*8; - if (size < MIN2) { - ap = ap1; - pools[id] = pool1; - } else if (size < MIN3) { - ap = ap2; - pools[id] = pool2; - } else { - ap = ap3; - pools[id] = pool3; - } - do { - MPS_RESERVE_BLOCK(res, objs[id], ap, size); - asserts(res == MPS_RES_OK, "alloc failed"); - } while (!mps_commit(ap, objs[id], size)); - total_size+=sizes[id]; - c = objs[id]; - *c = 43; - } else if (event.type == EVENT_FREE) { - id = event.free.id; - mps_free(pools[id], objs[id], sizes[id]); - total_size-=sizes[id]; - } - committed = mps_arena_committed(arena); - if (committed > maxcom) maxcom=committed; - fragacc += ((double) (committed-total_size))/((double) committed); - commacc += (double) committed; - sizeacc += (double) total_size; - count += 1; - } - report("maxcom", "%ld", maxcom); - report("fragavg", "%f", fragacc/count); - report("fragweighted", "%f", (commacc-sizeacc)/commacc); - report("commavg", "%f", commacc/count); - report("sizeavg", "%f", sizeacc/count); - - mps_ap_destroy(ap1); - mps_ap_destroy(ap2); - mps_ap_destroy(ap3); - mps_pool_destroy(pool1); - mps_pool_destroy(pool2); - mps_pool_destroy(pool3); - - mps_thread_dereg(thread); - mps_arena_destroy(arena); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/test/function/222.c b/mps/test/function/222.c deleted file mode 100644 index f59b99744eb..00000000000 --- a/mps/test/function/222.c +++ /dev/null @@ -1,134 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = EPDR*3 from af_six measuring fragmentation - language = c - link = testlib.o - stdin = af_six - parameters = COMLIMIT=(1024*1024*100) MIN1=8 MIN2=256 MIN3=4096 EXTENDBY=65536 -OUTPUT_SPEC - result = pass -END_HEADER -*/ - -#include "testlib.h" -#include "mpscepdl.h" -#include "mpsavm.h" - -#define MAXOBJS (30000) -#define ALIGN 8 - -mps_addr_t objs[MAXOBJS]; -size_t sizes[MAXOBJS]; -mps_pool_t pools[MAXOBJS]; -size_t total_size; -size_t committed; -int fragmentation; - -double fragacc; -double commacc; -double sizeacc; -double count; - -void *stackpointer; -mps_arena_t arena; - -static void test(void) -{ - mps_thr_t thread; - mps_pool_t pool1, pool2, pool3; - log_event event; - int id; - char *c; - size_t size; - unsigned long maxcom; - size_t avg1, avg2, avg3; - - maxcom = 0; - fragacc = 0; - commacc = 0; - sizeacc = 0; - count = 0; - - avg1 = 4*MIN1; - avg2 = 4*MIN2; - avg3 = 4*MIN3; - - report("avg1", "%ld", avg1); - report("avg2", "%ld", avg2); - report("avg3", "%ld", avg3); - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), (size_t) (1024*1024*100)), - "create space"); - cdie(mps_arena_commit_limit_set(arena, COMLIMIT), "commit limit"); - cdie(mps_thread_reg(&thread, arena), "register thread"); - - cdie( - mps_pool_create(&pool1, arena, mps_class_epdr(), - EXTENDBY, avg1, ALIGN), - "create EPDR pool (small)"); - - cdie( - mps_pool_create(&pool2, arena, mps_class_epdr(), - EXTENDBY, avg2, ALIGN), - "create EPDR pool (medium)"); - - cdie( - mps_pool_create(&pool3, arena, mps_class_epdr(), - EXTENDBY, avg3, ALIGN), - "create EPDR pool (big)"); - - committed = mps_arena_committed(arena); - - while (read_event(&event)) { - if (event.type == EVENT_ALLOC) { - id = event.alloc.id; - asserts(id < MAXOBJS, "MAXOBJS too small"); - size = event.alloc.size; - sizes[id] = size; - if (size < MIN2) { - pools[id] = pool1; - } else if (size < MIN3) { - pools[id] = pool2; - } else { - pools[id] = pool3; - } - die(mps_alloc(&objs[id], pools[id], size), "alloc"); - total_size+=sizes[id]; - c = objs[id]; - *c = 43; - } else if (event.type == EVENT_FREE) { - id = event.free.id; - mps_free(pools[id], objs[id], sizes[id]); - total_size-=sizes[id]; - } - committed = mps_arena_committed(arena); - if (committed > maxcom) maxcom=committed; - fragacc += ((double) (committed-total_size))/((double) committed); - commacc += (double) committed; - sizeacc += (double) total_size; - count += 1; - } - report("maxcom", "%ld", maxcom); - report("fragavg", "%f", fragacc/count); - report("fragweighted", "%f", (commacc-sizeacc)/commacc); - report("commavg", "%f", commacc/count); - report("sizeavg", "%f", sizeacc/count); - - mps_pool_destroy(pool1); - mps_pool_destroy(pool2); - mps_pool_destroy(pool3); - - mps_thread_dereg(thread); - mps_arena_destroy(arena); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/test/function/225.c b/mps/test/function/225.c deleted file mode 100644 index df6a03345f2..00000000000 --- a/mps/test/function/225.c +++ /dev/null @@ -1,45 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!21.c(trunk.4) $ - summary = EPDL allocate large promise, make it small, repeat - language = c - link = testlib.o - harness = 2.5 - parameters = EXTENDBY=65536 AVGSIZE=32 ALIGN=4 PROMISE=64 ITERATE=2000 -END_HEADER -*/ - -#include "testlib.h" -#include "mpscepdl.h" -#include "mpsavm.h" - -#define VMNZSIZE ((size_t) 30*1024*1024) - -static void test(void) { - mps_arena_t arena; - mps_pool_t pool; - mps_addr_t q; - int p; - - die(mps_arena_create(&arena, mps_arena_class_vmnz(), VMNZSIZE), "create"); - die(mps_arena_commit_limit_set(arena, VMNZSIZE), "commit limit"); - - die(mps_pool_create(&pool, arena, mps_class_epdl(), - EXTENDBY, AVGSIZE, ALIGN), "pool create"); - - for (p=0; p1)) lev1--; - mps_epvm_restore(pool1, lev1); - break; - case 2: - if (lev2==1) break; - lev2--; - while (ranint(2) && (lev2>1)) lev2--; - comment("Restore 2: %i", lev2); - mps_epvm_restore(pool2, lev2); - break; - case 3: - case 4: - if (lev11)) lev1--; - mps_epvm_restore(pool1, lev1); - break; - case 2: - break; - case 3: - case 4: - if (lev1 0) { - lev1--; - mps_epvm_restore(pool1, lev1); - } - mps_epvm_save(pool1); - lev1++; - } - j = ranint(40); - switch (j) { - case 1: - if (lev1==1) break; - lev1--; - mps_epvm_restore(pool1, lev1); - comment("Restore to %i", lev1); - while (ranint(2) && (lev1>1)) { - lev1--; - mps_epvm_restore(pool1, lev1); - } - break; - case 2: - break; - case 3: - case 4: - if (lev10)) lev1--; - mps_epvm_restore(pool1, lev1); - break; - case 2: - if (lev2==0) break; - lev2--; - while (ranint(2) && (lev2>0)) lev2--; - comment("Restore 2: %i", lev2); - mps_epvm_restore(pool2, lev2); - break; - case 3: - case 4: - if (lev1 i) { - comment("free %i", j); - sizes[j] = (size_t) 0; - } - } -} - - -static void mycheck(psobj *addr, size_t size) { - int i; - unsigned long ob, om, pb, pm; - - pb = (unsigned long) addr; - pm = pb+size; - - for (i=0; i= pm, - "overlapping objects: %p, %p", addr, addrs[i]); - } - } -} - - -static void myalloc(int i) { - size_t s; - psobj *a; - - s = 8 * (ranint(50)+1); - a = allocepvm(ap1s, s); - - comment("alloc %i at %p level %i", i, a, lev1); - - mycheck(a, s); - - addrs[i] = a; - sizes[i] = s; - levels[i] = lev1; -} - - -static void mysave(void) { - if (lev1 < MAX_SAVE) { - lev1++; - comment("save to %i", lev1); - mps_epvm_save(pool1); - } -} - -static int myfindblank(int *ii) { - int j; - - for (j=0; j0 && ranint(100)!=0) { - lev1--; - } - myrestore(lev1); - if (lev1 == 0) { - mysave(); - } - } - if (ranint(100)<20) { - mysave(); - } - } - - mps_ap_destroy(ap1s); - mps_pool_destroy(pool1); - mps_fmt_destroy(format); - mps_root_destroy(root); - mps_thread_dereg(thread); - mps_arena_destroy(arena); - comment("Destroyed arena"); - -} - - -int main(void) { - void *m; - stackpointer=&m; - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/test/function/88.c b/mps/test/function/88.c deleted file mode 100644 index 8e43a308d8d..00000000000 --- a/mps/test/function/88.c +++ /dev/null @@ -1,85 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!88.c(trunk.2) $ - summary = EPVM allocate and collect_world - language = c - link = testlib.o epvmfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscepvm.h" -#include "mpsavm.h" -#include "epvmfmt.h" - -#define MAX_SAVE 32 -#define INIT_SAVE 0 - -void *stackpointer; - -psobj *a[100]; - -static void test(void) -{ - mps_arena_t arena; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - - mps_pool_t pool1; - mps_epvm_save_level_t lev1; - mps_ap_t ap1s; - - int i, j; - - alloccomments = 1; - - /* create an arena that can't grow beyond 64M */ - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), (size_t) (1024*1024*64)), - "create arena"); - - cdie(mps_thread_reg(&thread, arena), "register thread"); - - cdie(mps_root_create_table(&root, arena, MPS_RANK_AMBIG, 0, - (mps_addr_t *)&a[0], 100), - "create root"); - - cdie(mps_fmt_create_A(&format, arena, &fmtepvm), "create format"); - - cdie(mps_pool_create(&pool1, arena, mps_class_epvm(), - format, MAX_SAVE, INIT_SAVE), "create pool1"); - - cdie(mps_ap_create(&ap1s, pool1, 0), "create ap1s"); - - lev1 = INIT_SAVE; - - for (i=0; i<10; i++) { - for (j=0; j<10000; j++) { - a[ranint(100)] = allocepvm(ap1s, (size_t) (8+8*ranint(16))); - } - mps_arena_collect(arena); - comment("collected %i", i); - } - - mps_ap_destroy(ap1s); - mps_pool_destroy(pool1); - mps_fmt_destroy(format); - mps_root_destroy(root); - mps_thread_dereg(thread); - mps_arena_destroy(arena); - comment("Destroyed arena"); - -} - - -int main(void) { - void *m; - stackpointer=&m; - - easy_tramp(test); - pass(); - return 0; -} - diff --git a/mps/test/function/89.c b/mps/test/function/89.c deleted file mode 100644 index 00d41edd6bb..00000000000 --- a/mps/test/function/89.c +++ /dev/null @@ -1,79 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = EPVM allocate and epvm_collect - language = c - link = testlib.o epvmfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscepvm.h" -#include "mpsavm.h" -#include "epvmfmt.h" - -#define MAX_SAVE 1000 -#define INIT_SAVE 12 - -void *stackpointer; - -static void test(void) -{ - mps_arena_t arena; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - - mps_pool_t pool1; - mps_epvm_save_level_t lev1; - mps_ap_t ap1s; - - int i, j; - - psobj *a; - -/* create an arena that can't grow beyond 64M */ - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), (size_t) (1024*1024*64)), - "create arena"); - - cdie(mps_thread_reg(&thread, arena), "register thread"); - - cdie(mps_fmt_create_A(&format, arena, &fmtepvm), "create format"); - - cdie(mps_pool_create(&pool1, arena, mps_class_epvm(), - format, MAX_SAVE, INIT_SAVE), "create pool1"); - - cdie(mps_ap_create(&ap1s, pool1, 0), "create ap1s"); - - lev1 = INIT_SAVE; - - for (i=0; i<50; i++) { - for (j=0; j<3000; j++) { - a = allocepvm(ap1s, (size_t) (8+8*ranint(500))); - } - comment("collecting..."); - mps_epvm_collect(pool1); - } - - mps_ap_destroy(ap1s); - mps_pool_destroy(pool1); - mps_fmt_destroy(format); - mps_thread_dereg(thread); - mps_arena_destroy(arena); - comment("Destroyed arena"); - -} - -int main(void) { - void *m; - stackpointer=&m; - - easy_tramp(test); - pass(); - return 0; -} - - - diff --git a/mps/test/function/90.c b/mps/test/function/90.c deleted file mode 100644 index ab95aeb0abd..00000000000 --- a/mps/test/function/90.c +++ /dev/null @@ -1,120 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!90.c(trunk.2) $ - summary = various EPVM functional tests - language = c - link = testlib.o epvmfmt.o -END_HEADER -*/ - -/* This test used to use ambiguous roots, but then EPVM was changed - so as not to "support" them. -*/ - -#include "testlib.h" -#include "mpscepvm.h" -#include "mpsavm.h" -#include "epvmfmt.h" - -#define MAX_SAVE 32 -#define INIT_SAVE 4 - -#define RT_SIZE 1000 - -void *stackpointer; - -static void test(void) -{ - mps_arena_t arena; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - - mps_pool_t pool1; - mps_ap_t ap1s, ap1p; - - unsigned int i, j, k; - - psobj *a[RT_SIZE], *b; - -/* create an arena that can't grow beyond 64M */ - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), (size_t) (1024*1024*64)), - "create arena"); - - cdie(mps_thread_reg(&thread, arena), "register thread"); - - cdie(mps_root_create_table(&root, arena, MPS_RANK_EXACT, 0, &a[0], RT_SIZE), - "create root"); - - cdie(mps_fmt_create_A(&format, arena, &fmtepvm), "create format"); - - cdie(mps_pool_create(&pool1, arena, mps_class_epvm(), - format, MAX_SAVE, INIT_SAVE), "create pool1"); - - cdie(mps_ap_create(&ap1s, pool1, 0), "create ap1s"); - - cdie(mps_ap_create(&ap1p, pool1, 1), "create ap1p"); - - asserts(sizeof(unsigned char) == 1, "surprise! -- characters too big!"); - - for (k=0; k<20; k++) { - comment("%i of 20", k); - - comment("allocate string objects of various sizes"); - - for (i=0; i<256; i++) { - a[i] = allocepvm(ap1s, (size_t) (8+8*i)); - for (j=0; j<(8+i*8); j++) { - *((unsigned char *) a[i]+j) = i; - } - } - - comment("allocate psobjects pointing to strings"); - - for (i=0; i<256; i++) { - b = allocepvm(ap1p, (size_t) 8); - b->obj = a[i]; - b->size = i+1; - a[i] = b; - } - - comment("collect"); - - mps_epvm_collect(pool1); - - comment("check objects are ok"); - - for (i=0; i<256; i++) { - b = a[i]->obj; - asserts(a[i]->size == i+1, "object %i wrong size", i); - for (j=0; j<(8+i*8); j++) { - asserts(*((unsigned char *) b+j) == i, "object %i corrupt at %i", i, j); - } - } - comment("finished"); - } - - mps_ap_destroy(ap1s); - mps_ap_destroy(ap1p); - mps_pool_destroy(pool1); - mps_fmt_destroy(format); - mps_root_destroy(root); - mps_thread_dereg(thread); - mps_arena_destroy(arena); - comment("Destroyed arena"); - -} - -int main(void) { - void *m; - stackpointer=&m; - - easy_tramp(test); - pass(); - return 0; -} - - - diff --git a/mps/test/function/91.c b/mps/test/function/91.c deleted file mode 100644 index c02bbca4d78..00000000000 --- a/mps/test/function/91.c +++ /dev/null @@ -1,90 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!91.c(trunk.3) $ - summary = EPVM time allocations - language = c - link = testlib.o epvmfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscepvm.h" -#include "mpsavm.h" -#include "epvmfmt.h" -#include - -#define MAX_SAVE 1 -#define INIT_SAVE 0 - -void *stackpointer; - - -static void timealloc(mps_pool_t pool, mps_ap_t ap, size_t size, - int num, int step) { - int i, j; - clock_t t0, t1; - int secs; - psobj *a; - - mps_epvm_save(pool); - t0 = clock(); - for (j=0; j - -#define MAX_SAVE 1 -#define INIT_SAVE 0 - -void *stackpointer; - -mps_word_t CheckLevel; - -#define CheckNONE 0 -#define CheckSHALLOW 1 -#define CheckDEEP 2 - -static void timealloc(mps_pool_t pool, mps_ap_t ap, size_t size, int num, int step) { - int i, j; - clock_t t0, t1; - int secs; - psobj *a; - - mps_epvm_save(pool); - t0 = clock(); - for (j=0; j - -#define MAX_SAVE 1 -#define INIT_SAVE 0 - -void *stackpointer; - - -static void timealloc(mps_pool_t pool, mps_ap_t ap, size_t size, - int num, int step) { - int i, j; - clock_t t0, t1; - int secs; - psobj *a; - - mps_epvm_save(pool); - t0 = clock(); - for (j=0; j - -#define MAX_SAVE 1 -#define INIT_SAVE 0 - -void *stackpointer; - -static void timealloc(mps_pool_t pool, mps_ap_t ap, size_t min, size_t max, size_t total) { - int i, j; - clock_t t0, t1; - int secs; - size_t size; - psobj *a; - - mps_epvm_save(pool); - t0 = clock(); - while (total>0) { - size = ranrange(min, max+1); - if (size > total) { - size = total; - } - a = allocepvm(ap, size); - total-=size; - } - t1 = clock(); - secs = 100*(t1-t0)/CLOCKS_PER_SEC; - comment("%i, %i, %i", total*8, (max+1)*4, secs); - mps_epvm_restore(pool, 0); - -}; - -static void test(void) -{ - mps_arena_t arena; - mps_thr_t thread; - mps_fmt_t format; - mps_pool_t pool1; - mps_ap_t ap1s; - - size_t size; - size_t avgsize; - - asserts(clock() != -1, "processor time not available"); - -/* create an arena that can't grow beyond 64M */ - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), (size_t) (1024*1024*64)), - "create arena"); - - cdie(mps_thread_reg(&thread, arena), "register thread"); - - cdie(mps_fmt_create_A(&format, arena, &fmtepvm), "create format"); - - cdie(mps_pool_create(&pool1, arena, mps_class_epvm(), - format, MAX_SAVE, INIT_SAVE), "create pool1"); - - cdie(mps_ap_create(&ap1s, pool1, 0), "create ap1s"); - - size = 1024ul*1024ul*10ul/8; /* 10 Megabytes */ - - for (avgsize=1; avgsize<128; avgsize+=1) { - timealloc(pool1, ap1s, 1, 2*avgsize-1, size); - } - - mps_ap_destroy(ap1s); - mps_pool_destroy(pool1); - mps_fmt_destroy(format); - mps_thread_dereg(thread); - mps_arena_destroy(arena); - comment("Destroyed arena"); - -} - -int main(void) { - void *m; - stackpointer=&m; - - easy_tramp(test); - pass(); - return 0; -} - - - diff --git a/mps/test/test/testlib/epvmfmt.c b/mps/test/test/testlib/epvmfmt.c deleted file mode 100644 index 66601ec57f1..00000000000 --- a/mps/test/test/testlib/epvmfmt.c +++ /dev/null @@ -1,141 +0,0 @@ -/* $HopeName: MMQA_harness!testlib:epvmfmt.c(trunk.6) $ -*/ - -#include "epvmfmt.h" -#include - -int alloccomments = 0; - -/* the scanning function doesn't try to fix null refs -*/ - -static mps_res_t epvmscan(mps_ss_t ss, mps_addr_t base, mps_addr_t limit); -static mps_addr_t epvmskip(mps_addr_t object); -static void epvmfwd(mps_addr_t object, mps_addr_t to); -static mps_addr_t epvmisfwd(mps_addr_t object); -static void epvmcopy(mps_addr_t object, mps_addr_t to); -static void epvmpad(mps_addr_t base, size_t size); - -static mps_res_t epvmscan(mps_ss_t ss, mps_addr_t base, mps_addr_t limit); - -mps_addr_t epvmskip(mps_addr_t object) { -/* error("skip called on EPVM object: %p", object); -*/ - asserts(((unsigned long) object & 7) == 0, - "epvmskip called on unaligned object %p", object); - return (mps_addr_t) ((char *)object + 8); -} - -void epvmfwd(mps_addr_t object, mps_addr_t to) { - error("fwd called on EPVM object: %p -> %p", object, to); -} - -mps_addr_t epvmisfwd(mps_addr_t object) { - error("isfwd called on EPVM object: %p", object); - return NULL; -} - -void epvmcopy(mps_addr_t object, mps_addr_t to) { - error("copy called on EPVM object: %p -> %p", object, to); -} - -void epvmpad(mps_addr_t base, size_t size) { - error("pad called in EPVM: %p, %u", base, size); -} - -struct mps_fmt_A_s fmtepvm = -{ - (mps_align_t) 8, - &epvmscan, - &epvmskip, - &epvmcopy, - &epvmfwd, - &epvmisfwd, - &epvmpad -}; - -/* in the following, size is the number of words you want - to allocate -*/ - -psobj *allocepvm(mps_ap_t ap, int size) { - psobj *a; - die(allocrepvm(&a, ap, size), "Reserve: "); - return a; -} - -mps_res_t allocrepvm(psobj **q, mps_ap_t ap, int size) { - mps_addr_t p; - int i; - size_t bytes; - mps_res_t res; - - asserts(sizeof(struct psobj) == 8, "Aaarg! How can EPVM pools possibly work"); - bytes = size*8; - - asserts(size > 0, "allocepvm with zero size"); - - do - { - res = mps_reserve(&p, ap, bytes); - if (res != MPS_RES_OK) { - return res; - } - *q=p; - - for(i=0; iobj = NULL; - (*q+i)->size = 0; - } - } - while (!mps_commit(ap, p, bytes)); - commentif(alloccomments, "allocated %p.", q); - - return MPS_RES_OK; -} - -void splatepvm(psobj *obj) { - obj->size = 0; -} - -mps_bool_t issplatepvm(psobj *obj) { - return (obj->size == 0); -} - -static mps_res_t epvmscan(mps_ss_t ss, mps_addr_t base, mps_addr_t limit) -{ - unsigned int i; - - MPS_SCAN_BEGIN(ss) - { - while (base < limit) - { - psobj *obj = base; - mps_res_t res; - mps_addr_t p; - - commentif(alloccomments, "scan %p", base); - - asserts(obj->size > 0, "scan on splatted object at %p", obj); - - p = obj->obj; - asserts(p != NULL, "NULL pointer in EPVM obj at %p", obj); - res = MPS_FIX(ss, (mps_addr_t *) &p); /* A ghastly PUN! */ - if (res != MPS_RES_OK) return res; - asserts(p != NULL, "reference in EPVM fixed to NULL at %p", obj); - obj->obj = p; - - for (i=1; isize; i++) { - p = obj->obj + i; - res = MPS_FIX(ss, (mps_addr_t *) &p); - if (res != MPS_RES_OK) return res; - asserts(p == obj->obj+i, "reference in EPVM changed at %p", obj); - } - base = (char *) base + 8; - } - } - MPS_SCAN_END(ss); - return MPS_RES_OK; -} - diff --git a/mps/test/test/testlib/epvmfmt.h b/mps/test/test/testlib/epvmfmt.h deleted file mode 100644 index 893227e4100..00000000000 --- a/mps/test/test/testlib/epvmfmt.h +++ /dev/null @@ -1,40 +0,0 @@ -/* $HopeName: MMQA_harness!testlib:epvmfmt.h(trunk.4) $ -epvmfmt.h - Format for objects in the EPVM pool. -*/ - -#ifndef epvmfmt_h -#define epvmfmt_h - -#include "testlib.h" - -extern int alloccomments; - -/* the counters are visible so that I can check whether things - get moved etc -*/ - -/* the object format is visible so tests that want to - can hack around with it -*/ - - -typedef struct psobj psobj; - -struct psobj { - psobj *obj; - mps_word_t size; -}; - -extern struct mps_fmt_A_s fmtepvm; - -psobj *allocepvm(mps_ap_t ap, int words); - -mps_res_t allocrepvm(psobj **, mps_ap_t ap, int words); - -void splatepvm(psobj *obj); - -mps_bool_t issplatepvm(psobj *obj); - -#endif - diff --git a/mps/test/test/testlib/manifest b/mps/test/test/testlib/manifest index 80f7e3db0ea..f4786164cc0 100644 --- a/mps/test/test/testlib/manifest +++ b/mps/test/test/testlib/manifest @@ -9,4 +9,3 @@ myfmt.c newfmt.c platform.c testlib.c -epvmfmt.c