diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2017-06-17 08:33:58 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2017-06-17 08:39:43 +0900 |
| commit | 08c385ff66ba7bca24ab30a06a925f364c7b0c84 (patch) | |
| tree | 21041d6a007a63d9fcfefe43d1e53a252f726713 /src | |
| parent | 819ccd3b859427e38d0b4e5a22ec0005b68c3b31 (diff) | |
| download | mruby-08c385ff66ba7bca24ab30a06a925f364c7b0c84.tar.gz mruby-08c385ff66ba7bca24ab30a06a925f364c7b0c84.zip | |
Mark the GC arena in `final_marking_phase`.
Arena can be modified during the marking phase.
Diffstat (limited to 'src')
| -rw-r--r-- | src/gc.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -835,7 +835,7 @@ obj_free(mrb_state *mrb, struct RBasic *obj, int end) static void root_scan_phase(mrb_state *mrb, mrb_gc *gc) { - size_t i, e; + int i, e; if (!is_minor_gc(gc)) { gc->gray_list = NULL; @@ -995,6 +995,12 @@ incremental_marking_phase(mrb_state *mrb, mrb_gc *gc, size_t limit) static void final_marking_phase(mrb_state *mrb, mrb_gc *gc) { + int i, e; + + /* mark arena */ + for (i=0,e=gc->arena_idx; i<e; i++) { + mrb_gc_mark(mrb, gc->arena[i]); + } mrb_gc_mark_gv(mrb); mark_context(mrb, mrb->c); mark_context(mrb, mrb->root_c); |
