From 136977f357499c05ea3159a9a1122ca49a7987af Mon Sep 17 00:00:00 2001 From: Yuichi Nishiwaki Date: Wed, 16 Oct 2013 09:22:15 +0900 Subject: [PATCH] [gc] show freed object counts --- src/gc.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/gc.c b/src/gc.c index 82dde731..c8f25d46 100644 --- a/src/gc.c +++ b/src/gc.c @@ -228,6 +228,8 @@ gc_sweep_phase(pic_state *pic) union header *base, *bp, *p; #if GC_DEBUG + int freed = 0; + puts("sweep started"); #endif @@ -284,12 +286,20 @@ gc_sweep_phase(pic_state *pic) p = p->s.ptr; } +#if GC_DEBUG + freed++; +#endif + goto retry; } if (p->s.ptr == base) break; } + +#if GC_DEBUG + printf("freed: %d counts\n", freed); +#endif } void