aboutsummaryrefslogtreecommitdiffstats
path: root/mps/code/amcss.c
diff options
context:
space:
mode:
Diffstat (limited to 'mps/code/amcss.c')
-rw-r--r--mps/code/amcss.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/mps/code/amcss.c b/mps/code/amcss.c
index 647d0525fc4..8b88dd38bec 100644
--- a/mps/code/amcss.c
+++ b/mps/code/amcss.c
@@ -47,7 +47,27 @@ static mps_addr_t exactRoots[exactRootsCOUNT];
47static mps_addr_t ambigRoots[ambigRootsCOUNT]; 47static mps_addr_t ambigRoots[ambigRootsCOUNT];
48 48
49 49
50/* report - report statistics from any messages */ 50/* alert -- synchronous alert of collection start/stop */
51
52static void alertfn(int alertcode, int whycode)
53{
54 switch(alertcode) {
55 case MPS_ALERT_COLLECTION_START: {
56 printf("\n^^^^^^ START (why: %d) ^^^^^^\n", whycode);
57 break;
58 }
59 case MPS_ALERT_COLLECTION_STOP: {
60 printf("vvvvvv STOP (why: %d) vvvvvv\n", whycode);
61 break;
62 }
63 default: {
64 cdie(0, "unknown alertcode");
65 break;
66 }
67 }
68}
69
70/* report -- report statistics from any messages */
51 71
52static void report(mps_arena_t arena) 72static void report(mps_arena_t arena)
53{ 73{
@@ -313,6 +333,7 @@ int main(int argc, char **argv)
313 "arena_create"); 333 "arena_create");
314 mps_message_type_enable(arena, mps_message_type_gc()); 334 mps_message_type_enable(arena, mps_message_type_gc());
315 mps_message_type_enable(arena, mps_message_type_gc_start()); 335 mps_message_type_enable(arena, mps_message_type_gc_start());
336 mps_alert_collection_set(arena, &alertfn);
316 die(mps_arena_commit_limit_set(arena, testArenaSIZE), "set limit"); 337 die(mps_arena_commit_limit_set(arena, testArenaSIZE), "set limit");
317 die(mps_thread_reg(&thread, arena), "thread_reg"); 338 die(mps_thread_reg(&thread, arena), "thread_reg");
318 mps_tramp(&r, test, arena, 0); 339 mps_tramp(&r, test, arena, 0);