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:
@@ -71,7 +71,7 @@ int main(int argc, const char* argv[]) {
|
||||
printf("Instantiating module...\n");
|
||||
wasm_instance_t* instance = NULL;
|
||||
wasm_trap_t *trap = NULL;
|
||||
error = wasmtime_instance_new(module, NULL, 0, &instance, &trap);
|
||||
error = wasmtime_instance_new(store, module, NULL, 0, &instance, &trap);
|
||||
if (error != NULL || trap != NULL)
|
||||
exit_with_error("failed to instantiate", error, trap);
|
||||
wasm_module_delete(module);
|
||||
|
||||
@@ -17,8 +17,8 @@ fn main() -> Result<()> {
|
||||
// debugged in GDB.
|
||||
let engine = Engine::new(Config::new().debug_info(true));
|
||||
let store = Store::new(&engine);
|
||||
let module = Module::from_file(&store, "target/wasm32-unknown-unknown/debug/fib.wasm")?;
|
||||
let instance = Instance::new(&module, &[])?;
|
||||
let module = Module::from_file(&engine, "target/wasm32-unknown-unknown/debug/fib.wasm")?;
|
||||
let instance = Instance::new(&store, &module, &[])?;
|
||||
|
||||
// Invoke `fib` export
|
||||
let fib = instance
|
||||
|
||||
Reference in New Issue
Block a user