From cce17d1a71c40772c7114159f07518fc64160eaa Mon Sep 17 00:00:00 2001 From: Jeffrey Charles Date: Thu, 17 Oct 2024 10:04:21 -0400 Subject: [PATCH] Rename wizer.initialize to initialize_runtime (#780) --- crates/cli/build.rs | 1 + crates/cli/src/codegen/static.rs | 1 + crates/core/src/lib.rs | 4 ++-- crates/core/src/main.rs | 4 ++-- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/crates/cli/build.rs b/crates/cli/build.rs index bb93aaef..4ebe2a2c 100644 --- a/crates/cli/build.rs +++ b/crates/cli/build.rs @@ -55,6 +55,7 @@ fn copy_javy_core() -> Result<()> { let mut wizer = wizer::Wizer::new(); let wizened = wizer + .init_func("initialize_runtime") .allow_wasi(true)? .wasm_bulk_memory(true) .run(read_file(&quickjs_provider_path)?.as_slice())?; diff --git a/crates/cli/src/codegen/static.rs b/crates/cli/src/codegen/static.rs index b0bcdb35..780da24d 100644 --- a/crates/cli/src/codegen/static.rs +++ b/crates/cli/src/codegen/static.rs @@ -81,6 +81,7 @@ impl CodeGen for StaticGenerator { }; let wasm = Wizer::new() + .init_func("initialize_runtime") .make_linker(Some(Rc::new(|engine| { let mut linker = Linker::new(engine); wasi_common::sync::add_to_linker(&mut linker, |_: &mut Option| unsafe { diff --git a/crates/core/src/lib.rs b/crates/core/src/lib.rs index 38a98779..4548a471 100644 --- a/crates/core/src/lib.rs +++ b/crates/core/src/lib.rs @@ -15,8 +15,8 @@ static mut COMPILE_SRC_RET_AREA: [u32; 2] = [0; 2]; static mut RUNTIME: OnceCell = OnceCell::new(); /// Used by Wizer to preinitialize the module. -#[export_name = "wizer.initialize"] -pub extern "C" fn init() { +#[export_name = "initialize_runtime"] +pub extern "C" fn initialize_runtime() { let runtime = runtime::new(Config::default()).unwrap(); unsafe { RUNTIME diff --git a/crates/core/src/main.rs b/crates/core/src/main.rs index dfebcbc7..e23ba255 100644 --- a/crates/core/src/main.rs +++ b/crates/core/src/main.rs @@ -15,8 +15,8 @@ const FUNCTION_MODULE_NAME: &str = "function.mjs"; static mut RUNTIME: OnceCell = OnceCell::new(); static mut BYTECODE: OnceCell> = OnceCell::new(); -#[export_name = "wizer.initialize"] -pub extern "C" fn init() { +#[export_name = "initialize_runtime"] +pub extern "C" fn initialize_runtime() { let _wasm_ctx = WasmCtx::new(); let js_runtime_config = Config::from_bits(