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:
Yury Delendik
2020-06-02 13:44:39 -05:00
committed by GitHub
parent b41330393d
commit 15c68f2cc1
61 changed files with 982 additions and 663 deletions

View File

@@ -4,10 +4,10 @@ use wasmtime::*;
#[test]
fn wrong_import_numbers() -> Result<()> {
let store = Store::default();
let module = Module::new(&store, r#"(module (import "" "" (func)))"#)?;
let module = Module::new(store.engine(), r#"(module (import "" "" (func)))"#)?;
assert!(Instance::new(&module, &[]).is_err());
assert!(Instance::new(&store, &module, &[]).is_err());
let func = Func::wrap(&store, || {});
assert!(Instance::new(&module, &[func.clone().into(), func.into()]).is_err());
assert!(Instance::new(&store, &module, &[func.clone().into(), func.into()]).is_err());
Ok(())
}