Skip to content

Commit cdededf

Browse files
committed
YJIT: Take VM lock in RubyVM::YJIT.code_gc
Code GC needs synchronization.
1 parent 93b6997 commit cdededf

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

yjit/src/yjit.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,12 @@ pub extern "C" fn rb_yjit_code_gc(_ec: EcPtr, _ruby_self: VALUE) -> VALUE {
139139
return Qnil;
140140
}
141141

142-
let cb = CodegenGlobals::get_inline_cb();
143-
let ocb = CodegenGlobals::get_outlined_cb();
144-
cb.code_gc(ocb);
142+
with_vm_lock(src_loc!(), || {
143+
let cb = CodegenGlobals::get_inline_cb();
144+
let ocb = CodegenGlobals::get_outlined_cb();
145+
cb.code_gc(ocb);
146+
});
147+
145148
Qnil
146149
}
147150

0 commit comments

Comments
 (0)