diff options
author | Takashi Kokubun <takashikkbn@gmail.com> | 2019-05-29 08:56:26 +0900 |
---|---|---|
committer | Takashi Kokubun <takashikkbn@gmail.com> | 2019-05-29 08:56:27 +0900 |
commit | 797d7efde18c5f7acf5264047842fd974f383ca9 (patch) | |
tree | 2538f8334a1aa155b62dcff2ed7a8cfe8695a08a /gc.c | |
parent | 6b5e712361cca8559ed66d5c1106e888c5971d39 (diff) | |
download | ruby-797d7efde18c5f7acf5264047842fd974f383ca9.tar.gz |
Prevent MJIT compilation from running while moving
pointers.
Instead of 4fe908c1643c3f355edd787bb651aefb53b996c0, just locking the MJIT
worker may be fine for this case. And also we might have the same issue
in all `gc_compact_after_gc` calls.
Diffstat (limited to 'gc.c')
-rw-r--r-- | gc.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -8272,6 +8272,8 @@ gc_compact_after_gc(rb_objspace_t *objspace, int use_toward_empty, int use_doubl { if (0) fprintf(stderr, "gc_compact_after_gc: %d,%d,%d\n", use_toward_empty, use_double_pages, use_verifier); + mjit_gc_start_hook(); // prevent MJIT from running while moving pointers related to ISeq + if (use_verifier) { gc_verify_internal_consistency(Qnil); } @@ -8315,6 +8317,8 @@ gc_compact_after_gc(rb_objspace_t *objspace, int use_toward_empty, int use_doubl (void)moved_list; #endif + mjit_gc_exit_hook(); // unlock MJIT here, because `rb_gc()` calls `mjit_gc_start_hook()` again. + /* GC after compaction to eliminate T_MOVED */ rb_gc(); } |