From ed161ae658f9722610fa9194d5804aa0fb207c48 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Fri, 8 Mar 2013 12:23:44 +0000 Subject: Don't accidentally leave the arena in the clamped state after calling mps_arena_collect: * In mpiscv, release the arena immediately after collecting. * In zmess, clamp the arena immediately after creating it. Copied from Perforce Change: 181094 ServerID: perforce.ravenbrook.com --- mps/code/mpsicv.c | 1 + mps/code/zmess.c | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'mps/code') diff --git a/mps/code/mpsicv.c b/mps/code/mpsicv.c index e46052b34c5..2ddd4344c59 100644 --- a/mps/code/mpsicv.c +++ b/mps/code/mpsicv.c @@ -552,6 +552,7 @@ static void *test(void *arg, size_t s) alignmentTest(arena); die(mps_arena_collect(arena), "collect"); + mps_arena_release(arena); mps_free(mv, alloced_obj, 32); alloc_v_test(mv); diff --git a/mps/code/zmess.c b/mps/code/zmess.c index 2f169b57e38..cd4ef83dd7c 100644 --- a/mps/code/zmess.c +++ b/mps/code/zmess.c @@ -58,7 +58,8 @@ * the last two messages (note: no "."), to test that * mps_arena_destroy copes with ungot messages. * - * Each script runs in a newly created arena. + * Each script runs in a newly created arena. The arena is clamped so + * that collections only happen when the script requests them. * * * CODE OVERVIEW @@ -408,6 +409,7 @@ static void testscriptA(const char *script) /* arena */ die(mps_arena_create(&arena, mps_arena_class_vm(), testArenaSIZE), "arena_create"); + mps_arena_clamp(arena); /* thr: used to stop/restart multiple threads */ die(mps_thread_reg(&thr, arena), "thread"); -- cgit v1.2.1