diff options
| author | Gareth Rees | 2013-03-08 12:23:44 +0000 |
|---|---|---|
| committer | Gareth Rees | 2013-03-08 12:23:44 +0000 |
| commit | ed161ae658f9722610fa9194d5804aa0fb207c48 (patch) | |
| tree | 012983073b70423c38ec7da188da5de51f8bad56 /mps/code | |
| parent | 8232da84809ee4a2ea9fc63e8ba294bfd87920d8 (diff) | |
| download | emacs-ed161ae658f9722610fa9194d5804aa0fb207c48.tar.gz emacs-ed161ae658f9722610fa9194d5804aa0fb207c48.zip | |
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
Diffstat (limited to 'mps/code')
| -rw-r--r-- | mps/code/mpsicv.c | 1 | ||||
| -rw-r--r-- | mps/code/zmess.c | 4 |
2 files changed, 4 insertions, 1 deletions
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) | |||
| 552 | alignmentTest(arena); | 552 | alignmentTest(arena); |
| 553 | 553 | ||
| 554 | die(mps_arena_collect(arena), "collect"); | 554 | die(mps_arena_collect(arena), "collect"); |
| 555 | mps_arena_release(arena); | ||
| 555 | 556 | ||
| 556 | mps_free(mv, alloced_obj, 32); | 557 | mps_free(mv, alloced_obj, 32); |
| 557 | alloc_v_test(mv); | 558 | 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 @@ | |||
| 58 | * the last two messages (note: no "."), to test that | 58 | * the last two messages (note: no "."), to test that |
| 59 | * mps_arena_destroy copes with ungot messages. | 59 | * mps_arena_destroy copes with ungot messages. |
| 60 | * | 60 | * |
| 61 | * Each script runs in a newly created arena. | 61 | * Each script runs in a newly created arena. The arena is clamped so |
| 62 | * that collections only happen when the script requests them. | ||
| 62 | * | 63 | * |
| 63 | * | 64 | * |
| 64 | * CODE OVERVIEW | 65 | * CODE OVERVIEW |
| @@ -408,6 +409,7 @@ static void testscriptA(const char *script) | |||
| 408 | /* arena */ | 409 | /* arena */ |
| 409 | die(mps_arena_create(&arena, mps_arena_class_vm(), testArenaSIZE), | 410 | die(mps_arena_create(&arena, mps_arena_class_vm(), testArenaSIZE), |
| 410 | "arena_create"); | 411 | "arena_create"); |
| 412 | mps_arena_clamp(arena); | ||
| 411 | 413 | ||
| 412 | /* thr: used to stop/restart multiple threads */ | 414 | /* thr: used to stop/restart multiple threads */ |
| 413 | die(mps_thread_reg(&thr, arena), "thread"); | 415 | die(mps_thread_reg(&thr, arena), "thread"); |