From f146287eff6577105d73fdca4f6037fa97db11b5 Mon Sep 17 00:00:00 2001 From: Yuichi Nishiwaki Date: Thu, 21 Nov 2013 06:30:33 -0800 Subject: [PATCH] load_stdlib releases arena objects every time evaluating exprssion --- src/init.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/init.c b/src/init.c index 89a72523..05eccec0 100644 --- a/src/init.c +++ b/src/init.c @@ -25,7 +25,7 @@ pic_load_stdlib(pic_state *pic) { static const char *fn = "piclib/built-in.scm"; FILE *file; - int n, i; + int n, i, ai; pic_value v, vs; struct pic_proc *proc; @@ -41,6 +41,7 @@ pic_load_stdlib(pic_state *pic) abort(); } + ai = pic_gc_arena_preserve(pic); for (i = 0; i < n; ++i, vs = pic_cdr(pic, vs)) { v = pic_car(pic, vs); @@ -57,6 +58,8 @@ pic_load_stdlib(pic_state *pic) fputs("fatal error: built-in.scm evaluation failure", stderr); abort(); } + + pic_gc_arena_restore(pic, ai); } #if DEBUG