From 055272f0d5853cd48ffb39bf6bddd8e9a2801ae7 Mon Sep 17 00:00:00 2001 From: Yuichi Nishiwaki Date: Mon, 27 Jan 2014 22:20:46 +0900 Subject: [PATCH] arena management in pic_list --- src/pair.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/pair.c b/src/pair.c index e30d3882..30291d46 100644 --- a/src/pair.c +++ b/src/pair.c @@ -58,6 +58,7 @@ pic_list_p(pic_state *pic, pic_value obj) pic_value pic_list(pic_state *pic, size_t c, ...) { + int ai = pic_gc_arena_preserve(pic); va_list ap; pic_value v; @@ -69,6 +70,10 @@ pic_list(pic_state *pic, size_t c, ...) } va_end(ap); + + pic_gc_arena_restore(pic, ai); + pic_gc_protect(pic, v); + return pic_reverse(pic, v); }