Skip to content

Commit

Permalink
fixup! feat: implement memory.atomic.notify,wait32,wait64
Browse files Browse the repository at this point in the history
Signed-off-by: Harald Hoyer <[email protected]>
  • Loading branch information
haraldh committed Nov 17, 2022
1 parent 95df1a8 commit 74003f8
Show file tree
Hide file tree
Showing 11 changed files with 97 additions and 292 deletions.
16 changes: 8 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ members = [
"crates/cli-flags",
"crates/environ/fuzz",
"crates/jit-icache-coherence",
"crates/parking_spot",
"crates/wasmtime-parking_spot",
"crates/winch",
"examples/fib-debug/wasm",
"examples/wasi/wasm",
Expand Down
201 changes: 0 additions & 201 deletions crates/parking_spot/LICENSE-APACHE

This file was deleted.

25 changes: 0 additions & 25 deletions crates/parking_spot/LICENSE-MIT

This file was deleted.

2 changes: 1 addition & 1 deletion crates/runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ anyhow = { workspace = true }
memfd = "0.6.1"
paste = "1.0.3"
encoding_rs = { version = "0.8.31", optional = true }
parking_spot = { path = "../parking_spot", version = "0.1.0" }
wasmtime-parking_spot = { path = "../wasmtime-parking_spot" }

[target.'cfg(target_os = "macos")'.dependencies]
mach = "0.3.2"
Expand Down
11 changes: 11 additions & 0 deletions crates/runtime/src/instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,17 @@ impl Instance {
}
}

/// Get a locally defined or imported memory.
pub(crate) fn get_runtime_memory(&mut self, index: MemoryIndex) -> &mut Memory {
if let Some(defined_index) = self.module().defined_memory_index(index) {
unsafe { &mut *self.get_defined_memory(defined_index) }
} else {
let import = self.imported_memory(index);
let ctx = unsafe { &mut *import.vmctx };
unsafe { &mut *ctx.instance_mut().get_defined_memory(import.index) }
}
}

/// Return the indexed `VMMemoryDefinition`.
fn memory(&self, index: DefinedMemoryIndex) -> VMMemoryDefinition {
unsafe { VMMemoryDefinition::load(self.memory_ptr(index)) }
Expand Down
Loading

0 comments on commit 74003f8

Please sign in to comment.