summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/array.c2
-rw-r--r--src/class.c2
2 files changed, 3 insertions, 1 deletions
diff --git a/src/array.c b/src/array.c
index 97f76f8da..f0fcdb10d 100644
--- a/src/array.c
+++ b/src/array.c
@@ -917,7 +917,7 @@ inspect_ary(mrb_state *mrb, mrb_value ary, mrb_value list)
mrb_str_buf_cat(mrb, arystr, head, sizeof(head));
for(i=0; i<RARRAY_LEN(ary); i++) {
- mrb_int ai = mrb_gc_arena_save(mrb);
+ int ai = mrb_gc_arena_save(mrb);
if (i > 0) {
mrb_str_buf_cat(mrb, arystr, sep, sizeof(sep));
diff --git a/src/class.c b/src/class.c
index a3defc2ae..0ba702919 100644
--- a/src/class.c
+++ b/src/class.c
@@ -293,10 +293,12 @@ void
mrb_define_method_id(mrb_state *mrb, struct RClass *c, mrb_sym mid, mrb_func_t func, int aspec)
{
struct RProc *p;
+ int ai = mrb_gc_arena_save(mrb);
p = mrb_proc_new_cfunc(mrb, func);
p->target_class = c;
mrb_define_method_raw(mrb, c, mid, p);
+ mrb_gc_arena_restore(mrb, ai);
}
void