Skip to content

Commit

Permalink
Merge pull request #3757 from wasmerio/wasi-no-vm
Browse files Browse the repository at this point in the history
WASI without VM internals
  • Loading branch information
syrusakbary authored Apr 9, 2023
2 parents 46568be + 29b124e commit b01fba3
Show file tree
Hide file tree
Showing 12 changed files with 358 additions and 306 deletions.
48 changes: 24 additions & 24 deletions Cargo.lock

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

15 changes: 15 additions & 0 deletions lib/api/src/externals/memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,21 @@ impl Memory {
}

/// Attempts to clone this memory (if its clonable) in a new store
pub fn clone_in_store(
&self,
store: &impl AsStoreRef,
new_store: &mut impl AsStoreMut,
) -> Option<Self> {
if !self.ty(store).shared {
// We should only be able to duplicate in a new store if the memory is shared
return None;
}
self.0
.try_clone(&store)
.map(|new_memory| Self::new_from_existing(new_store, new_memory))
}

/// Attempts to duplicate this memory (if its clonable) in a new store
pub fn duplicate_in_store(
&self,
store: &impl AsStoreRef,
Expand Down
Loading

0 comments on commit b01fba3

Please sign in to comment.