From e7166c9bb78e20531a9cbb372e460ecd12603b5e Mon Sep 17 00:00:00 2001 From: Takashi Kokubun Date: Tue, 18 Oct 2022 09:07:11 -0700 Subject: Allow passing a Rust closure to rb_iseq_callback (#6575) --- yjit/src/invariants.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'yjit/src/invariants.rs') diff --git a/yjit/src/invariants.rs b/yjit/src/invariants.rs index 07de3374c8..3ca57b4943 100644 --- a/yjit/src/invariants.rs +++ b/yjit/src/invariants.rs @@ -532,9 +532,7 @@ pub extern "C" fn rb_yjit_tracing_invalidate_all() { // Stop other ractors since we are going to patch machine code. with_vm_lock(src_loc!(), || { // Make it so all live block versions are no longer valid branch targets - unsafe { rb_yjit_for_each_iseq(Some(invalidate_all_blocks_for_tracing)) }; - - extern "C" fn invalidate_all_blocks_for_tracing(iseq: IseqPtr) { + for_each_iseq(|iseq| { if let Some(payload) = unsafe { get_iseq_payload(iseq) } { // C comment: // Leaking the blocks for now since we might have situations where @@ -554,7 +552,7 @@ pub extern "C" fn rb_yjit_tracing_invalidate_all() { // Reset output code entry point unsafe { rb_iseq_reset_jit_func(iseq) }; - } + }); let cb = CodegenGlobals::get_inline_cb(); -- cgit v1.2.3