Skip to content

Commit

Permalink
Rename wizer.initialize to initialize_runtime (#780)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffcharles authored Oct 17, 2024
1 parent e765721 commit cce17d1
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions crates/cli/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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())?;
Expand Down
1 change: 1 addition & 0 deletions crates/cli/src/codegen/static.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<WasiCtx>| unsafe {
Expand Down
4 changes: 2 additions & 2 deletions crates/core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ static mut COMPILE_SRC_RET_AREA: [u32; 2] = [0; 2];
static mut RUNTIME: OnceCell<Runtime> = 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
Expand Down
4 changes: 2 additions & 2 deletions crates/core/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ const FUNCTION_MODULE_NAME: &str = "function.mjs";
static mut RUNTIME: OnceCell<Runtime> = OnceCell::new();
static mut BYTECODE: OnceCell<Vec<u8>> = 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(
Expand Down

0 comments on commit cce17d1

Please sign in to comment.