mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-04-06 14:22:31 -07:00
Convert to chains
Copied from Perforce Change: 21665 ServerID: perforce.ravenbrook.com
This commit is contained in:
parent
74adfd5792
commit
a9daec78a2
1 changed files with 29 additions and 15 deletions
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
TEST_HEADER
|
||||
id = $HopeName$
|
||||
id = $HopeName: MMQA_test_function!17.c(trunk.6) $
|
||||
summary = create and destroy lots of pools (interleaved)
|
||||
language = c
|
||||
link = testlib.o newfmt.o
|
||||
|
|
@ -9,38 +9,52 @@ END_HEADER
|
|||
|
||||
#include "testlib.h"
|
||||
#include "mpscamc.h"
|
||||
#include "mpsavm.h"
|
||||
#include "newfmt.h"
|
||||
|
||||
static void test(void) {
|
||||
mps_space_t space;
|
||||
|
||||
#define genCOUNT (3)
|
||||
|
||||
static mps_gen_param_s testChain[genCOUNT] = {
|
||||
{ 6000, 0.90 }, { 8000, 0.65 }, { 16000, 0.50 } };
|
||||
|
||||
|
||||
static void test(void)
|
||||
{
|
||||
mps_arena_t arena;
|
||||
mps_pool_t pool;
|
||||
mps_pool_t pool1;
|
||||
mps_thr_t thread;
|
||||
mps_fmt_t format;
|
||||
mps_chain_t chain;
|
||||
|
||||
int p;
|
||||
|
||||
die(mps_space_create(&space), "create");
|
||||
die(mps_thread_reg(&thread, space), "register thread");
|
||||
die(mps_fmt_create_A(&format, space, &fmtA), "create format");
|
||||
cdie(mps_arena_create(&arena, mps_arena_class_vm(), mmqaArenaSIZE),
|
||||
"create arena");
|
||||
die(mps_thread_reg(&thread, arena), "register thread");
|
||||
die(mps_fmt_create_A(&format, arena, &fmtA), "create format");
|
||||
cdie(mps_chain_create(&chain, arena, genCOUNT, testChain), "chain_create");
|
||||
|
||||
die(mps_pool_create(&pool1, space, mps_class_amc(), format),
|
||||
"create pool");
|
||||
die(mmqa_pool_create_chain(&pool1, arena, mps_class_amc(), format, chain),
|
||||
"create pool");
|
||||
|
||||
for (p=0; p<10000; p++) {
|
||||
die(mps_pool_create(&pool, space, mps_class_amc(), format),
|
||||
"create pool");
|
||||
comment("%i", p);
|
||||
mps_pool_destroy(pool1);
|
||||
pool1=pool;
|
||||
for (p = 0; p < 10000; p++) {
|
||||
die(mmqa_pool_create_chain(&pool, arena, mps_class_amc(), format, chain),
|
||||
"create pool");
|
||||
comment("%i", p);
|
||||
mps_pool_destroy(pool1);
|
||||
pool1=pool;
|
||||
}
|
||||
|
||||
mps_pool_destroy(pool);
|
||||
mps_chain_destroy(chain);
|
||||
mps_fmt_destroy(format);
|
||||
mps_thread_dereg(thread);
|
||||
mps_space_destroy(space);
|
||||
mps_arena_destroy(arena);
|
||||
}
|
||||
|
||||
|
||||
int main(void)
|
||||
{
|
||||
easy_tramp(test);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue