diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2021-10-10 16:20:07 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2021-10-10 20:12:11 +0900 |
| commit | 8e5d89df7f7ef827bc410f331c20da57c5bd3c72 (patch) | |
| tree | 88f2ba3cdd3e8365d90e821267ab0d2137605818 /src/vm.c | |
| parent | 5cdf1eabdd5b57170d600b673ca3dd1f08809495 (diff) | |
| download | mruby-8e5d89df7f7ef827bc410f331c20da57c5bd3c72.tar.gz mruby-8e5d89df7f7ef827bc410f331c20da57c5bd3c72.zip | |
vm.c: unify `mrb_gc_arena_restore` and `mrb_gc_arena_shrink`.
Diffstat (limited to 'src/vm.c')
| -rw-r--r-- | src/vm.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -64,6 +64,7 @@ mrb_gc_arena_shrink(mrb_state *mrb, int idx) mrb_gc *gc = &mrb->gc; int capa = gc->arena_capa; + mrb->gc.arena_idx = idx; if (idx < capa / 4) { capa >>= 2; if (capa < MRB_GC_ARENA_SIZE) { @@ -76,7 +77,7 @@ mrb_gc_arena_shrink(mrb_state *mrb, int idx) } } #else -#define mrb_gc_arena_shrink(mrb,idx) +#define mrb_gc_arena_shrink(mrb,idx) mrb_gc_arena_restore(mrb,idx) #endif #define CALL_MAXARGS 127 @@ -1544,7 +1545,6 @@ RETRY_TRY_BLOCK: else { recv = MRB_METHOD_FUNC(m)(mrb, recv); } - mrb_gc_arena_restore(mrb, ai); mrb_gc_arena_shrink(mrb, ai); if (mrb->exc) goto L_RAISE; ci = mrb->c->ci; @@ -1600,7 +1600,6 @@ RETRY_TRY_BLOCK: /* prepare stack */ if (MRB_PROC_CFUNC_P(m)) { recv = MRB_PROC_CFUNC(m)(mrb, recv); - mrb_gc_arena_restore(mrb, ai); mrb_gc_arena_shrink(mrb, ai); if (mrb->exc) goto L_RAISE; /* pop stackpos */ |
