static void test(void)
{
 mps_space_t space;
 mps_thr_t thread;
 mps_root_t root;
 mps_addr_t a[30];

 cdie(mps_space_create(&space), "create space");

 cdie(mps_thread_reg(&thread, space), "register thread");

 cdie(mps_root_create_table(&root, space,
        MPS_RANK_AMBIG, MPS_RM_MAX+1, a, sizeof a),
      "root create");

}
static void test(void)
{
 mps_space_t space;
 mps_thr_t thread;
 mps_root_t root;

 cdie(mps_space_create(&space), "create space");

 cdie(mps_thread_reg(&thread, space), "register thread");

 cdie(mps_root_create_reg(&root, space, MPS_RANK_AMBIG,
                      MPS_RM_MAX+1, 
                      thread, mps_stack_scan_ambig, stackpointer, 0),
      "root create");

}
static void test(void)
{
 mps_space_t space;
 mps_thr_t thread;
 mps_addr_t a[32];
 mps_root_t root;

 cdie(mps_space_create(&space), "create space");

 cdie(mps_thread_reg(&thread, space), "register thread");

 cdie(mps_root_create_fmt(&root, space, MPS_RANK_MAX+1, 0, 
                      fmtscan, a, &a[32]),
      "root create");

}
Esempio n. 4
0
static void test(void)
{
 mps_arena_t arena;
 mps_thr_t thread;
 mps_root_t root;
 mps_addr_t a[30];

 cdie(mps_arena_create(&arena, mps_arena_class_vm(), mmqaArenaSIZE), "create arena");

 cdie(mps_thread_reg(&thread, arena), "register thread");

 cdie(mps_root_create_table(&root, NULL,
        mps_rank_ambig(), 0, a, sizeof a),
      "root create");

}
Esempio n. 5
0
int main(void)
{
  mps_arena_t arena;
  mps_thr_t thread;
  void *r;

  die(mps_arena_create(&arena, mps_arena_class_vm(), testArenaSIZE),
      "arena_create\n");
  die(mps_thread_reg(&thread, arena), "thread_reg\n");
  mps_tramp(&r, test, arena, 0);
  mps_thread_dereg(thread);
  mps_arena_destroy(arena);

  fflush(stdout); /* synchronize */
  return 0;
}
Esempio n. 6
0
static void test(void)
{
 mps_arena_t arena;
 mps_thr_t thread;
 mps_addr_t a[32];
 mps_root_t root;

 cdie(mps_arena_create(&arena, mps_arena_class_vm(), mmqaArenaSIZE), "create arena");

 cdie(mps_thread_reg(&thread, arena), "register thread");

 cdie(mps_root_create_fmt(&root, arena, mps_rank_ambig(), HIGHBIT_INT, 
                      fmtscan, a, &a[32]),
      "root create");

}
Esempio n. 7
0
static void test(void)
{
 mps_arena_t arena;
 mps_thr_t thread;
 mps_root_t root;

 cdie(mps_arena_create(&arena, mps_arena_class_vm(), mmqaArenaSIZE), "create arena");

 cdie(mps_thread_reg(&thread, arena), "register thread");

 cdie(mps_root_create_reg(&root, arena, mps_rank_ambig(),
                      MPS_RM_MAX+1, 
                      thread, mps_stack_scan_ambig, stackpointer, 0),
      "root create");

}
static void test(void)
{
 mps_space_t space;
 mps_thr_t thread;
 mps_addr_t a[32];
 mps_root_t root;

 cdie(mps_space_create(&space), "create space");

 cdie(mps_thread_reg(&thread, space), "register thread");

 cdie(mps_root_create_fmt(&root, space, MPS_RANK_AMBIG, 0, 
                      fmtscan, a, (mps_addr_t)(((char *)(&a[0]))+1)),
      "root create");

}
Esempio n. 9
0
static void test(void)
{
 mps_arena_t arena;
 mps_ld_s ld;
 mps_thr_t thread;
 mps_addr_t p;

 cdie(mps_arena_create(&arena, mps_arena_class_vm(), mmqaArenaSIZE), "create arena");

 cdie(mps_thread_reg(&thread, arena), "register thread");

 mps_ld_reset(&ld, arena);

 mps_ld_add(&ld, arena, &p);

 mps_ld_isstale(NULL, arena, &p);
}
static void test(void)
{
 mps_space_t space;
 mps_ld_s ld;
 mps_thr_t thread;
 mps_addr_t p;

 cdie(mps_space_create(&space), "create space");

 cdie(mps_thread_reg(&thread, space), "register thread");

 mps_ld_reset(&ld, space);

 mps_ld_add(&ld, space, &p);

 mps_ld_isstale(&ld, UNALIGNED, &p);
}
Esempio n. 11
0
int main(int argc, char *argv[])
{
  mps_arena_t arena;
  mps_thr_t thread;
  void *r;

  testlib_init(argc, argv);

  die(mps_arena_create(&arena, mps_arena_class_vm(), testArenaSIZE),
      "arena_create\n");
  die(mps_thread_reg(&thread, arena), "thread_reg\n");
  mps_tramp(&r, test, arena, 0);
  mps_thread_dereg(thread);
  mps_arena_destroy(arena);

  printf("%s: Conclusion: Failed to find any defects.\n", argv[0]);
  return 0;
}
static void test(void)
{
 mps_space_t space;
 mps_thr_t thread;

 cdie(mps_space_create(&space), "create space");

 cdie(mps_thread_reg(&thread, space), "register thread");

 mps_thread_dereg(thread);
 comment("Deregistered thread.");

 mps_thread_dereg(thread);
 comment("Deregistered thread again.");

 mps_space_destroy(space);
 comment("Destroyed space.");
}
Esempio n. 13
0
File: 40.c Progetto: Ravenbrook/mps
static void test(void *stack_pointer)
{
 mps_arena_t arena;
 mps_pool_t pool;
 mps_thr_t thread;

 cdie(mps_arena_create(&arena, mps_arena_class_vm(), mmqaArenaSIZE), "create arena");

 cdie(mps_thread_reg(&thread, arena), "register thread");

 cdie(
  mps_pool_create(
     &pool, arena, mps_class_mfs(), (size_t) 32, (size_t) 33), 
  "create pool");

 mps_pool_destroy(pool);

}
static void test(void)
{
 mps_space_t space;
 mps_pool_t pool;
 mps_thr_t thread;

 cdie(mps_space_create(&space), "create space");

 cdie(mps_thread_reg(&thread, space), "register thread");

 cdie(
  mps_pool_create(
     &pool, space, mps_class_mfs(), (size_t) 128, (size_t) 0), 
  "create pool");

 mps_pool_destroy(pool);

}
Esempio n. 15
0
static void test(void)
{
 mps_arena_t arena;
 mps_thr_t thread;

 cdie(mps_arena_create(&arena, mps_arena_class_vm(), mmqaArenaSIZE), "create arena");

 mps_arena_destroy(arena);
 comment("Destroyed arena.");

 cdie(mps_thread_reg(&thread, arena), "register thread");

 mps_thread_dereg(thread);
 comment("Deregistered thread.");

 mps_arena_destroy(arena);
 comment("Destroyed arena.");
}
Esempio n. 16
0
static void test(void)
{
 mps_arena_t arena;
 mps_pool_t pool;
 mps_thr_t thread;
 mps_root_t root;

 mps_chain_t chain;
 mps_fmt_t format;
 mps_ap_t ap;
 mps_addr_t p;

 cdie(mps_arena_create(&arena, mps_arena_class_vm(), mmqaArenaSIZE), "create arena");

 cdie(mps_thread_reg(&thread, arena), "register thread");

 cdie(
  mps_root_create_reg(&root, arena, mps_rank_ambig(), 0, thread,
   mps_stack_scan_ambig, stackpointer, 0),
  "create root");

 cdie(
  mps_fmt_create_A(&format, arena, &fmtA),
  "create format");

 formatcomments = 0;

 cdie(mps_chain_create(&chain, arena, genCOUNT, testChain), "chain_create");

 cdie(
  mps_pool_create(&pool, arena, mps_class_amc(), format, chain),
  "create pool");

 cdie(
  mps_ap_create(&ap, pool, mps_rank_exact()),
  "create ap");

do{
 cdie(
  mps_reserve(&p, ap, (size_t) 64), "reserve");
}
while (!mps_commit(ap, p, (size_t) HIGHBIT_SIZE+64));

}
static void test(void)
{
 mps_arena_t arena;
 mps_pool_t pool;
 mps_thr_t thread;
 mps_root_t root;

 mps_fmt_t format;
 mps_chain_t chain;
 mps_ap_t ap;

 mycell *a;

 cdie(mps_arena_create(&arena, mps_arena_class_vm(), mmqaArenaSIZE),
      "create arena");

 cdie(mps_thread_reg(&thread, arena), "register thread");
 cdie(
  mps_root_create_reg(&root, arena, MPS_RANK_AMBIG, 0, thread,
   mps_stack_scan_ambig, stackpointer, 0),
  "create root");

 cdie(
  mps_fmt_create_A(&format, arena, &fmtA),
  "create format");
 cdie(mps_chain_create(&chain, arena, genCOUNT, testChain), "chain_create");

 cdie(mmqa_pool_create_chain(&pool, arena, mps_class_amc(), format, chain),
      "create pool");

 cdie(
  mps_ap_create(&ap, pool, MPS_RANK_EXACT),
  "create ap");

  a = allocdumb(ap, 1024*1024*80);

 mps_ap_destroy(ap);
 mps_pool_destroy(pool);
 mps_chain_destroy(chain);
 mps_fmt_destroy(format);
 mps_root_destroy(root);
 mps_thread_dereg(thread);
 mps_arena_destroy(arena);
}
Esempio n. 18
0
static void test(void)
{
 mps_arena_t arena;
 mps_pool_t pool;
 mps_thr_t thread;
 mps_root_t root;

 mps_ap_t ap;
 mps_fmt_t format;
 mps_chain_t chain;

 cdie(mps_arena_create(&arena, mps_arena_class_vm(), mmqaArenaSIZE),
      "create arena");

 cdie(mps_thread_reg(&thread, arena), "register thread");

 cdie(mps_root_create_reg(&root, arena, mps_rank_ambig(), 0, thread,
                          mps_stack_scan_ambig, stackpointer, 0),
      "create root");

 cdie(mps_fmt_create_A(&format, arena, &fmtA), "create format");
 cdie(mps_chain_create(&chain, arena, genCOUNT, testChain), "chain_create");

 cdie(mmqa_pool_create_chain(&pool, arena, mps_class_amc(), format, chain),
      "create pool");

 die(mps_ap_create(&ap, pool, mps_rank_exact()), "create ap");

 while (mps_collections(arena) == 0) {
  allocdumb(ap, 1024*256);
 }

 mps_ap_destroy(ap);

 mps_pool_destroy(pool);
 comment("Destroyed pool.");

 mps_chain_destroy(chain);
 mps_fmt_destroy(format);
 mps_root_destroy(root);
 mps_thread_dereg(thread);
 mps_arena_destroy(arena);
}
Esempio n. 19
0
int main(int argc, char **argv)
{
  mps_arena_t arena;
  mps_thr_t thread;
  void *r;

  randomize(argc, argv);

  die(mps_arena_create(&arena, mps_arena_class_vm(), testArenaSIZE),
      "arena_create\n");
  die(mps_thread_reg(&thread, arena), "thread_reg\n");
  mps_tramp(&r, test, arena, 0);
  mps_thread_dereg(thread);
  mps_arena_destroy(arena);

  fflush(stdout); /* synchronize */
  fprintf(stderr, "\nConclusion:  Failed to find any defects.\n");
  return 0;
}
Esempio n. 20
0
File: 66.c Progetto: Ravenbrook/mps
static void test(void *stack_pointer)
{
 void *marker = ▮
 mps_arena_t arena;
 mps_pool_t pool;
 mps_thr_t thread;
 mps_root_t root;
 mps_fmt_t format;
 mps_ap_t ap;
 mps_addr_t p, q, unaligned;

 cdie(mps_arena_create_k(&arena, mps_arena_class_vm(), mps_args_none), "create arena");
 mps_arena_park(arena);
 cdie(mps_thread_reg(&thread, arena), "register thread");
 cdie(mps_root_create_thread(&root, arena, thread, marker), "create root");
 cdie(mps_fmt_create_A(&format, arena, &fmtA), "create format");
 MPS_ARGS_BEGIN(args) {
   MPS_ARGS_ADD(args, MPS_KEY_FORMAT, format);
   cdie(mps_pool_create_k(&pool, arena, mps_class_ams(), args), "pool");
 } MPS_ARGS_END(args);
 cdie(mps_ap_create(&ap, pool, mps_rank_exact()), "ap");

 /* p is in the AMS pool */
 p = allocone(ap, 0, NULL, NULL, sizeof(mycell));

 /* q is in the AMS pool with unaligned exact reference to p */
 unaligned = (void *)((char*)p + 1);
 q = allocone(ap, 1, p, unaligned, sizeof(mycell));

 mps_arena_start_collect(arena);
 mps_arena_park(arena);

 /* Keep q (and thus p) alive during the collection. */
 report("q", "%p", q);

 mps_ap_destroy(ap);
 mps_pool_destroy(pool);
 mps_fmt_destroy(format);
 mps_root_destroy(root);
 mps_thread_dereg(thread);
 mps_arena_destroy(arena);
}
Esempio n. 21
0
static void test(void)
{
 mps_arena_t arena;
 mps_thr_t thread;
 mps_root_t root;

 cdie(mps_arena_create(&arena, mps_arena_class_vm(), mmqaArenaSIZE), "create arena");

 cdie(mps_thread_reg(&thread, arena), "register thread");

 cdie(
  mps_root_create_reg(&root, arena, mps_rank_ambig(), 0, thread,
   mps_stack_scan_ambig, stackpointer, 0),
  "create root");

 cdie(
  mps_fmt_create_A(NULL, arena, &fmtA),
  "create format");

}
static void test(void)
{
 mps_space_t space;
 mps_pool_t pool;
 mps_thr_t thread;
 mps_root_t root;

 mps_fmt_t format;
 mps_ap_t ap;
 mps_addr_t p;

 cdie(mps_space_create(&space), "create space");

 cdie(mps_thread_reg(&thread, space), "register thread");

 cdie(
  mps_root_create_reg(&root, space, MPS_RANK_AMBIG, 0, thread,
   mps_stack_scan_ambig, stackpointer, 0),
  "create root");

 cdie(
  mps_fmt_create_A(&format, space, &fmtA),
  "create format");

 formatcomments = 0;

 cdie(
  mps_pool_create(&pool, space, mps_class_amc(), format),
  "create pool");

 cdie(
  mps_ap_create(&ap, pool, MPS_RANK_EXACT),
  "create ap");

do{
 cdie(
  mps_reserve(&p, ap, (size_t) 64), "reserve");
}
while (!mps_commit(NULL, p, (size_t) 64));

}
static void test(void)
{
 mps_space_t space;
 mps_pool_t pool;
 mps_thr_t thread;
 mps_root_t root;

 cdie(mps_space_create(&space), "create space");

 cdie(mps_thread_reg(&thread, space), "register thread");

 cdie(
  mps_root_create_reg(&root, space, MPS_RANK_AMBIG, 0, thread,
   mps_stack_scan_ambig, stackpointer, 0),
  "create root");

 cdie(
  mps_fmt_create_A(UNALIGNED, space, &fmtA),
  "create format");

}
Esempio n. 24
0
static void test(void)
{
 mps_arena_t arena;
 mps_pool_t pool;
 mps_thr_t thread;
 mps_root_t root;

 mps_chain_t chain;
 mps_fmt_t format;
 mps_ap_t ap;

 cdie(mps_arena_create(&arena, mps_arena_class_vm(), mmqaArenaSIZE), "create arena");

 cdie(mps_thread_reg(&thread, arena), "register thread");

 cdie(
  mps_root_create_reg(&root, arena, mps_rank_ambig(), 0, thread,
   mps_stack_scan_ambig, stackpointer, 0),
  "create root");

 cdie(
  mps_fmt_create_A(&format, arena, &fmtA),
  "create format");

 formatcomments = 0;

 cdie(mps_chain_create(&chain, arena, genCOUNT, testChain), "chain_create");

 ddie(
  mps_pool_create(&pool, arena, mps_class_amc(), format, chain),
  "create pool");

 cdie(
  mps_ap_create(&ap, pool, mps_rank_exact()),
  "create ap");

 mps_ap_destroy(UNALIGNED);

}
Esempio n. 25
0
File: 100.c Progetto: bhanug/mps
static void test(void)
{
 mps_thr_t thread;

 cdie(mps_arena_create(&arena, mps_arena_class_vm(), mmqaArenaSIZE), "create arena");
 cdie(mps_thread_reg(&thread, arena), "register thread");

 dotest(SEQ, 8, 8, 1000, 10000);
 dotest(RAN, 8, 8, 1000, 10000);
 dotest(SEQGAP, 8, 8, 1000, 10000);
 dotest(RANGAP, 8, 8, 1000, 10000);

 dotest(SEQ, 8,      8, 10000, 0);
 dotest(SEQ, 8,   4096, 10000, 0); /* 4 K */
 dotest(SEQ, 8,   8192, 10000, 0); /* 8 K */
 dotest(SEQ, 8,  16384, 10000, 0); /* 16 K */
 dotest(SEQ, 8,  32768, 10000, 0); /* 32 K */
 dotest(SEQ, 8,  65536, 10000, 0); /* 64 K */
 dotest(SEQ, 8, 131072, 10000, 0); /* 128 K */

 dotest(SEQ, 8,      8, 100000, 0);
 dotest(SEQ, 8,   4096, 100000, 0); /* 4 K */
 dotest(SEQ, 8,   8192, 100000, 0); /* 8 K */
 dotest(SEQ, 8,  16384, 100000, 0); /* 16 K */
 dotest(SEQ, 8,  32768, 100000, 0); /* 32 K */
 dotest(SEQ, 8,  65536, 100000, 0); /* 64 K */
 dotest(SEQ, 8, 131072, 100000, 0); /* 128 K */

 dotest(SEQ, 4, 4, 100, 10000);
 dotest(SEQ, 5, 5, 100, 10000);
 dotest(SEQ, 15, 15, 100, 10000);
 dotest(SEQ, 64, 64, 100, 10000);

 dotest(RAN, 4, 4, 100, 10000);
 dotest(SEQ, 64, 64, 100, 1000);

 mps_thread_dereg(thread);
 mps_arena_destroy(arena);
}
static void test(void)
{
 mps_thr_t thread;

 cdie(mps_space_create(&space), "create space");
 cdie(mps_thread_reg(&thread, space), "register thread");

 dotest(SEQ, 8, 8, 1000, 10000);
 dotest(RAN, 8, 8, 1000, 10000);
 dotest(SEQGAP, 8, 8, 1000, 10000);
 dotest(RANGAP, 8, 8, 1000, 10000);

 dotest(SEQ, 8,      8, 10000, 0);
 dotest(SEQ, 8,   4096, 10000, 0); /* 4 K */
 dotest(SEQ, 8,   8192, 10000, 0); /* 8 K */
 dotest(SEQ, 8,  16384, 10000, 0); /* 16 K */
 dotest(SEQ, 8,  32768, 10000, 0); /* 32 K */
 dotest(SEQ, 8,  65536, 10000, 0); /* 64 K */
 dotest(SEQ, 8, 131072, 10000, 0); /* 128 K */

 dotest(SEQ, 8,      8, 100000, 0);
 dotest(SEQ, 8,   4096, 100000, 0); /* 4 K */
 dotest(SEQ, 8,   8192, 100000, 0); /* 8 K */
 dotest(SEQ, 8,  16384, 100000, 0); /* 16 K */
 dotest(SEQ, 8,  32768, 100000, 0); /* 32 K */
 dotest(SEQ, 8,  65536, 100000, 0); /* 64 K */
 dotest(SEQ, 8, 131072, 100000, 0); /* 128 K */

 dotest(SEQ, 4, 4, 100, 10000);
 dotest(SEQ, 5, 5, 100, 10000);
 dotest(SEQ, 15, 15, 100, 10000);
 dotest(SEQ, 64, 64, 100, 10000);

 dotest(RAN, 4, 4, 100, 10000);
 dotest(SEQ, 64, 64, 100, 1000);

 mps_thread_dereg(thread);
 mps_space_destroy(space);
}
Esempio n. 27
0
static void test(void)
{
 mps_thr_t thread;
 mps_pool_t pool;
 mps_addr_t a;

 cdie(mps_arena_create(&arena, mps_arena_class_vm(),
  (size_t) (1024*1024*50)), "create arena");
 cdie(mps_thread_reg(&thread, arena), "register thread");

 die(mps_pool_create(&pool, arena, mps_class_mv_debug(), &debugOpts,
                     (size_t)8192, (size_t)8, (size_t)65536),
     "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);
}
Esempio n. 28
0
static void test(void)
{
 mps_arena_t arena;
 mps_pool_t pool;
 mps_thr_t thread;

 mps_addr_t a,b;

 cdie(mps_arena_create(&arena, mps_arena_class_vm(), mmqaArenaSIZE), "create arena");

 cdie(mps_thread_reg(&thread, arena), "register thread");

 cdie(mps_pool_create_k(&pool, arena, mps_class_mv_debug(), mps_args_none),
      "create pool");

 die(mps_alloc(&a, pool, 8),
     "alloc a");
 die(mps_alloc(&b, pool, 32),
     "alloc b");
 mps_free(pool, a, 9);
 mps_pool_destroy(pool);

}
Esempio n. 29
0
static void test(void)
{
 mps_arena_t arena;
 mps_pool_t pool;
 mps_thr_t thread;

 mps_addr_t a;

 cdie(mps_arena_create(&arena, mps_arena_class_vm(), mmqaArenaSIZE), "create arena");

 cdie(mps_thread_reg(&thread, arena), "register thread");

 cdie(
  mps_pool_create(
     &pool, arena, mps_class_mv(),
     (size_t) 4096, (size_t) 32, (size_t) 64*1024),
  "create pool");

 die(mps_alloc(&a, pool, HIGHBIT_SIZE+8),
     "allocation failed (correct)");
 mps_pool_destroy(pool);

}
Esempio n. 30
0
static void test(void)
{
 mps_arena_t arena;
 mps_pool_t pool;
 mps_thr_t thread;

 size_t mysize;

 cdie(mps_arena_create(&arena, mps_arena_class_vm(), mmqaArenaSIZE), "create arena");

 cdie(mps_thread_reg(&thread, arena), "register thread");

 mysize = 8;

 cdie(
  mps_pool_create(
     &pool, arena, mps_class_mfs(), (size_t) 8, mysize),
  "create pool");

 mps_alloc(UNALIGNED, pool, mysize);
 mps_pool_destroy(pool);

}