From c53bf58e7ecc32eac386b24e6d10c01e0ee5b277 Mon Sep 17 00:00:00 2001 From: Yuichi Nishiwaki Date: Mon, 14 Oct 2013 17:07:09 +0900 Subject: [PATCH] move debug prints --- src/gc.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/gc.c b/src/gc.c index 8e294ff7..d0ae1869 100644 --- a/src/gc.c +++ b/src/gc.c @@ -240,9 +240,10 @@ gc_sweep_phase(pic_state *pic) } } -static void +void pic_gc_run(pic_state *pic) { + puts("gc run!"); gc_mark_phase(pic); gc_sweep_phase(pic); } @@ -252,14 +253,12 @@ pic_obj_alloc(pic_state *pic, size_t size, enum pic_tt tt) { struct pic_object *obj; - pic_gc_run(pic); obj = (struct pic_object *)gc_alloc(pic, size); if (obj == NULL) { - puts("gc run!"); pic_gc_run(pic); obj = (struct pic_object *)gc_alloc(pic, size); if (obj == NULL) - pic_raise(pic, "memory exhausted"); + pic_raise(pic, "GC memory exhausted"); } obj->tt = tt;