arena management in pic_list

This commit is contained in:
Yuichi Nishiwaki 2014-01-27 22:20:46 +09:00
parent b5cf174b5c
commit 055272f0d5
1 changed files with 5 additions and 0 deletions

View File

@ -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);
}