summaryrefslogtreecommitdiff
path: root/zjit/src/lib.rs
diff options
context:
space:
mode:
authorTakashi Kokubun <[email protected]>2025-02-12 16:50:29 -0800
committerTakashi Kokubun <[email protected]>2025-04-18 21:52:58 +0900
commit9cfb860cb3aec755fd2d97d8116d019f24886c28 ()
tree704eb257450cfc73cf12268b8e2b3d91f78208f9 /zjit/src/lib.rs
parentd550a9b1244b2c73e7018bcadaf368c417938154 (diff)
Let tests share the same ZJITState::init()
to share the initialization of other globals in the future as well
Notes: Merged: https://.com/ruby/ruby/pull/13131
-rw-r--r--zjit/src/lib.rs7
1 files changed, 4 insertions, 3 deletions
@@ -14,7 +14,7 @@ mod disasm;
mod options;
use codegen::gen_function;
-use options::get_option;
use state::ZJITState;
use crate::cruby::*;
@@ -23,13 +23,14 @@ use crate::cruby::*;
pub static mut rb_zjit_enabled_p: bool = false;
/// Initialize ZJIT, given options allocated by rb_zjit_init_options()
-#[cfg(not(test))]
#[no_mangle]
pub extern "C" fn rb_zjit_init(options: *const u8) {
// Catch panics to avoid UB for unwinding into C frames.
// See https://doc.rust-lang.org/nomicon/exception-safety.html
let result = std::panic::catch_unwind(|| {
- ZJITState::init(options);
rb_bug_panic_hook();