mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-14 23:40:39 -08:00
Convert to chains
Copied from Perforce Change: 21697 ServerID: perforce.ravenbrook.com
This commit is contained in:
parent
55b2893611
commit
f402f22522
1 changed files with 13 additions and 16 deletions
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
TEST_HEADER
|
||||
id = $HopeName: MMQA_test_function!81.c(trunk.3) $
|
||||
id = $HopeName: MMQA_test_function!81.c(trunk.4) $
|
||||
summary = run out of memory while collecting
|
||||
language = c
|
||||
link = testlib.o fastfmt.o
|
||||
|
|
@ -13,6 +13,12 @@ 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;
|
||||
|
||||
|
||||
|
|
@ -24,6 +30,7 @@ static void test(void)
|
|||
mps_root_t root, root1;
|
||||
|
||||
mps_fmt_t format;
|
||||
mps_chain_t chain;
|
||||
mps_ap_t ap;
|
||||
|
||||
mycell *a, *b;
|
||||
|
|
@ -31,7 +38,6 @@ static void test(void)
|
|||
int j;
|
||||
|
||||
/* create an arena that can't grow beyond 15 Mb */
|
||||
|
||||
cdie(mps_arena_create(&arena, mps_arena_class_vm(), (size_t)(1024*1024*15)),
|
||||
"create arena");
|
||||
|
||||
|
|
@ -47,9 +53,10 @@ static void test(void)
|
|||
|
||||
cdie(mps_fmt_create_A(&format, arena, &fmtA),
|
||||
"create format");
|
||||
cdie(mps_chain_create(&chain, arena, genCOUNT, testChain), "chain_create");
|
||||
|
||||
cdie(mps_pool_create(&pool, arena, mps_class_amc(), format),
|
||||
"create pool");
|
||||
die(mmqa_pool_create_chain(&pool, arena, mps_class_amc(), format, chain),
|
||||
"create pool");
|
||||
|
||||
cdie(mps_ap_create(&ap, pool, MPS_RANK_EXACT),
|
||||
"create ap");
|
||||
|
|
@ -58,8 +65,7 @@ static void test(void)
|
|||
|
||||
/* allocate at least 100 * 10K = 10M */
|
||||
|
||||
for (j=0; j<100; j++)
|
||||
{
|
||||
for (j = 0; j < 100; j++) {
|
||||
comment("%i of 100.", j);
|
||||
a = allocone(ap, 2, MPS_RANK_EXACT);
|
||||
setref(a, 0, b);
|
||||
|
|
@ -73,21 +79,12 @@ static void test(void)
|
|||
mps_arena_collect(arena);
|
||||
|
||||
mps_ap_destroy(ap);
|
||||
comment("Destroyed ap.");
|
||||
|
||||
mps_pool_destroy(pool);
|
||||
comment("Destroyed pool.");
|
||||
|
||||
mps_chain_destroy(chain);
|
||||
mps_fmt_destroy(format);
|
||||
comment("Destroyed format.");
|
||||
|
||||
mps_root_destroy(root);
|
||||
mps_root_destroy(root1);
|
||||
comment("Destroyed roots.");
|
||||
|
||||
mps_thread_dereg(thread);
|
||||
comment("Deregistered thread.");
|
||||
|
||||
mps_arena_destroy(arena);
|
||||
comment("Destroyed arena.");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue