summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--mrbgems/mruby-hash-ext/src/hash-ext.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/mrbgems/mruby-hash-ext/src/hash-ext.c b/mrbgems/mruby-hash-ext/src/hash-ext.c
index 298559686..937a7fddd 100644
--- a/mrbgems/mruby-hash-ext/src/hash-ext.c
+++ b/mrbgems/mruby-hash-ext/src/hash-ext.c
@@ -23,12 +23,14 @@ static mrb_value
hash_values_at(mrb_state *mrb, mrb_value hash)
{
mrb_value *argv, result;
- int argc, i;
+ int argc, i, ai;
mrb_get_args(mrb, "*", &argv, &argc);
result = mrb_ary_new_capa(mrb, argc);
+ ai = mrb_gc_arena_save(mrb);
for (i = 0; i < argc; i++) {
mrb_ary_push(mrb, result, mrb_hash_get(mrb, hash, argv[i]));
+ mrb_gc_arena_restore(mrb, ai);
}
return result;
}