Disconnects Store state fields from Compiler (#1761)
* Moves CodeMemory, VMInterrupts and SignatureRegistry from Compiler * CompiledModule holds CodeMemory and GdbJitImageRegistration * Store keeps track of its JIT code * Makes "jit_int.rs" stuff Send+Sync * Adds the threads example.
This commit is contained in:
@@ -7,7 +7,8 @@ use wasmtime::*;
|
||||
use wasmtime_wasi::{Wasi, WasiCtx};
|
||||
|
||||
fn main() -> Result<()> {
|
||||
let store = Store::default();
|
||||
let engine = Engine::default();
|
||||
let store = Store::new(&engine);
|
||||
|
||||
// First set up our linker which is going to be linking modules together. We
|
||||
// want our linker to have wasi available, so we set that up here as well.
|
||||
@@ -16,8 +17,8 @@ fn main() -> Result<()> {
|
||||
wasi.add_to_linker(&mut linker)?;
|
||||
|
||||
// Load and compile our two modules
|
||||
let linking1 = Module::from_file(&store, "examples/linking1.wat")?;
|
||||
let linking2 = Module::from_file(&store, "examples/linking2.wat")?;
|
||||
let linking1 = Module::from_file(&engine, "examples/linking1.wat")?;
|
||||
let linking2 = Module::from_file(&engine, "examples/linking2.wat")?;
|
||||
|
||||
// Instantiate our first module which only uses WASI, then register that
|
||||
// instance with the linker since the next linking will use it.
|
||||
|
||||
Reference in New Issue
Block a user