From a0a8a94abc00c8d7f79c8deac7e859c3cff807af Mon Sep 17 00:00:00 2001 From: Yuichi Nishiwaki Date: Tue, 29 Oct 2013 16:40:25 +0900 Subject: [PATCH] add gc stress test --- include/picconf.h | 1 + src/gc.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/include/picconf.h b/include/picconf.h index e3c1388e..ef767615 100644 --- a/include/picconf.h +++ b/include/picconf.h @@ -19,6 +19,7 @@ /* enable all debug flags */ #define DEBUG 1 +#define GC_STRESS 1 #if DEBUG # define GC_DEBUG 1 diff --git a/src/gc.c b/src/gc.c index 92dc16d9..1912d1b6 100644 --- a/src/gc.c +++ b/src/gc.c @@ -398,6 +398,10 @@ pic_obj_alloc(pic_state *pic, size_t size, enum pic_tt tt) { struct pic_object *obj; +#if GC_STRESS + pic_gc_run(pic); +#endif + obj = (struct pic_object *)gc_alloc(pic, size); if (obj == NULL) { pic_gc_run(pic);