mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
make arena_idx restoration per irep, not per load
This commit is contained in:
+2
-2
@@ -337,6 +337,7 @@ read_rite_irep_record(mrb_state *mrb, unsigned char *src, mrb_irep *irep, uint32
|
||||
mrb_int fix_num;
|
||||
mrb_float f;
|
||||
mrb_value str;
|
||||
int ai = mrb_gc_arena_save(mrb);
|
||||
|
||||
recordStart = src;
|
||||
buf = mrb_malloc(mrb, bufsize);
|
||||
@@ -489,6 +490,7 @@ read_rite_irep_record(mrb_state *mrb, unsigned char *src, mrb_irep *irep, uint32
|
||||
|
||||
*len = src - recordStart;
|
||||
error_exit:
|
||||
mrb_gc_arena_restore(mrb, ai);
|
||||
if (buf)
|
||||
mrb_free(mrb, buf);
|
||||
|
||||
@@ -502,7 +504,6 @@ mrb_read_irep(mrb_state *mrb, const char *bin)
|
||||
uint32_t len = 0;
|
||||
unsigned char *src;
|
||||
rite_binary_header bin_header;
|
||||
int ai = mrb_gc_arena_save(mrb);
|
||||
|
||||
if ((mrb == NULL) || (bin == NULL)) {
|
||||
return MRB_DUMP_INVALID_ARGUMENT;
|
||||
@@ -539,7 +540,6 @@ mrb_read_irep(mrb_state *mrb, const char *bin)
|
||||
|
||||
mrb->irep_len += nirep;
|
||||
error_exit:
|
||||
mrb_gc_arena_restore(mrb, ai);
|
||||
if (ret != MRB_DUMP_OK) {
|
||||
for (n=0,i=sirep; n<nirep; n++,i++) {
|
||||
if (mrb->irep[i]) {
|
||||
|
||||
Reference in New Issue
Block a user