From de8350c3c8eb9db10d352cb599fa9a3df1ff28a4 Mon Sep 17 00:00:00 2001 From: Pekka Pirinen Date: Wed, 14 Mar 2001 20:17:19 +0000 Subject: [PATCH] Convert to chains Copied from Perforce Change: 21748 ServerID: perforce.ravenbrook.com --- mps/qa/function/75.c | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/mps/qa/function/75.c b/mps/qa/function/75.c index 17dfd210bb4..dac161501af 100644 --- a/mps/qa/function/75.c +++ b/mps/qa/function/75.c @@ -1,6 +1,6 @@ /* TEST_HEADER - id = $HopeName: MMQA_test_function!75.c(trunk.4) $ + id = $HopeName: MMQA_test_function!75.c(trunk.5) $ summary = AWL pool should get collected (cf request.dylan.170322) language = c link = testlib.o rankfmt.o @@ -13,17 +13,25 @@ END_HEADER #include "rankfmt.h" +#define genCOUNT (3) + +static mps_gen_param_s testChain[genCOUNT] = { + { 6000, 0.90 }, { 8000, 0.65 }, { 16000, 0.50 } }; + + void *stackpointer; mps_arena_t arena; -static void test(void) { +static void test(void) +{ mps_pool_t poolamc; mps_thr_t thread; mps_root_t root0, root1; mps_fmt_t format; + mps_chain_t chain; mps_ap_t apamc; mycell *a; @@ -34,7 +42,6 @@ static void test(void) { "create arena"); cdie(mps_thread_reg(&thread, arena), "register thread"); - cdie(mps_root_create_reg(&root0, arena, MPS_RANK_AMBIG, 0, thread, mps_stack_scan_ambig, stackpointer, 0), "create root"); @@ -46,8 +53,10 @@ static void test(void) { cdie(mps_fmt_create_A(&format, arena, &fmtA), "create format"); - cdie(mps_pool_create(&poolamc, arena, mps_class_amc(), format), - "create pool"); + cdie(mps_chain_create(&chain, arena, genCOUNT, testChain), "chain_create"); + + die(mmqa_pool_create_chain(&poolamc, arena, mps_class_amc(), format, chain), + "create pool"); cdie(mps_ap_create(&apamc, poolamc, MPS_RANK_EXACT), "create ap"); @@ -65,17 +74,10 @@ static void test(void) { comment("Destroyed roots."); mps_ap_destroy(apamc); - comment("Destroyed ap."); - mps_pool_destroy(poolamc); - comment("Destroyed pool."); - + mps_chain_destroy(chain); mps_fmt_destroy(format); - comment("Destroyed format."); - mps_thread_dereg(thread); - comment("Deregistered thread."); - mps_arena_destroy(arena); comment("Destroyed arena."); @@ -83,7 +85,8 @@ static void test(void) { } -int main(void) { +int main(void) +{ void *m; stackpointer=&m; /* hack to get stack pointer */