Refactor shared memory internals, expose embedder methods (#5311)
This commit refactors the internals of `wasmtime_runtime::SharedMemory` a bit to expose the necessary functions to invoke from the `wasmtime::SharedMemory` layer. Notably some items are moved out of the `RwLock` from prior, such as the type and the `VMMemoryDefinition`. Additionally the organization around the `atomic_*` methods has been redone to ensure that the `wasmtime`-layer abstraction has a single method to call into which everything else uses as well.
This commit is contained in:
@@ -966,8 +966,8 @@ impl Instance {
|
||||
let def_ptr = self.memories[defined_memory_index]
|
||||
.as_shared_memory()
|
||||
.unwrap()
|
||||
.vmmemory_ptr_mut();
|
||||
ptr::write(ptr, def_ptr);
|
||||
.vmmemory_ptr();
|
||||
ptr::write(ptr, def_ptr.cast_mut());
|
||||
} else {
|
||||
ptr::write(owned_ptr, self.memories[defined_memory_index].vmmemory());
|
||||
ptr::write(ptr, owned_ptr);
|
||||
|
||||
Reference in New Issue
Block a user