1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-28 08:11:05 -08:00

No need for separate ams and lo formats.

Copied from Perforce
 Change: 194133
This commit is contained in:
Gareth Rees 2018-06-23 21:01:15 +01:00
parent c28b52472a
commit e54d414bfb

View file

@ -23,7 +23,7 @@ static void test(void)
mps_pool_t pool_ams, pool_lo;
mps_thr_t thread;
mps_root_t root;
mps_fmt_t fmt_ams, fmt_lo;
mps_fmt_t fmt;
mps_ap_t ap_ams, ap_lo;
mps_addr_t p, q, out_of_bounds;
size_t header = sizeof(mycell);
@ -35,15 +35,14 @@ static void test(void)
MPS_ARGS_BEGIN(args) {
MPS_ARGS_ADD(args, MPS_KEY_FMT_HEADER_SIZE, header);
fmtargs(args + 1);
cdie(mps_fmt_create_k(&fmt_lo, arena, args), "lo format");
cdie(mps_fmt_create_k(&fmt, arena, args), "lo format");
} MPS_ARGS_END(args);
cdie(mps_fmt_create_A(&fmt_ams, arena, &fmtA), "ams format");
MPS_ARGS_BEGIN(args) {
MPS_ARGS_ADD(args, MPS_KEY_FORMAT, fmt_ams);
MPS_ARGS_ADD(args, MPS_KEY_FORMAT, fmt);
cdie(mps_pool_create_k(&pool_ams, arena, mps_class_ams(), args), "ams pool");
} MPS_ARGS_END(args);
MPS_ARGS_BEGIN(args) {
MPS_ARGS_ADD(args, MPS_KEY_FORMAT, fmt_lo);
MPS_ARGS_ADD(args, MPS_KEY_FORMAT, fmt);
cdie(mps_pool_create_k(&pool_lo, arena, mps_class_lo(), args), "lo pool");
} MPS_ARGS_END(args);
cdie(mps_ap_create(&ap_ams, pool_ams, mps_rank_exact()), "ams ap");
@ -57,7 +56,7 @@ static void test(void)
/* q is in the AMS pool with exact reference to p and out-of-bounds object */
out_of_bounds = (void *)((char*)p - header);
q = allocone(ap_ams, 1, p, out_of_bounds, sizeof(mycell));
q = allocheader(ap_ams, 1, p, out_of_bounds, sizeof(mycell), header);
mps_arena_start_collect(arena);
mps_arena_park(arena);
@ -68,8 +67,7 @@ static void test(void)
mps_ap_destroy(ap_ams);
mps_pool_destroy(pool_lo);
mps_pool_destroy(pool_ams);
mps_fmt_destroy(fmt_lo);
mps_fmt_destroy(fmt_ams);
mps_fmt_destroy(fmt);
mps_root_destroy(root);
mps_thread_dereg(thread);
mps_arena_destroy(arena);