mirror of
https://github.com/mii443/wasmer.git
synced 2025-12-10 22:58:18 +00:00
Rename fork() to duplicate()
Renames all the memory fork() functions to duplicate(), since this is what they actually do. They enable forking, but that is a seprate functionality.
This commit is contained in:
@@ -54,7 +54,7 @@ impl VMMemory {
|
||||
}
|
||||
|
||||
/// Copies this memory to a new memory
|
||||
pub fn fork(&self) -> Result<VMMemory, wasmer_types::MemoryError> {
|
||||
pub fn duplicate(&self) -> Result<VMMemory, wasmer_types::MemoryError> {
|
||||
let new_memory = crate::Memory::new_internal(self.ty.clone())?;
|
||||
|
||||
#[cfg(feature = "tracing")]
|
||||
|
||||
4
lib/api/src/js/externals/memory.rs
vendored
4
lib/api/src/js/externals/memory.rs
vendored
@@ -265,9 +265,9 @@ impl Memory {
|
||||
}
|
||||
|
||||
/// Copies this memory to a new memory
|
||||
pub fn fork(&mut self, store: &impl AsStoreRef) -> Result<VMMemory, MemoryError> {
|
||||
pub fn duplicate(&mut self, store: &impl AsStoreRef) -> Result<VMMemory, MemoryError> {
|
||||
let mem = self.handle.get(store.as_store_ref().objects());
|
||||
mem.fork()
|
||||
mem.duplicate()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -117,10 +117,12 @@ mod tests {
|
||||
.unwrap()
|
||||
}
|
||||
}
|
||||
|
||||
fn try_clone(&self) -> Option<Box<dyn LinearMemory + 'static>> {
|
||||
None
|
||||
}
|
||||
fn fork(&mut self) -> Result<Box<dyn LinearMemory + 'static>, MemoryError> {
|
||||
|
||||
fn duplicate(&mut self) -> Result<Box<dyn LinearMemory + 'static>, MemoryError> {
|
||||
let mem = self.mem.clone();
|
||||
Ok(Box::new(Self {
|
||||
memory_definition: Some(UnsafeCell::new(VMMemoryDefinition {
|
||||
|
||||
Reference in New Issue
Block a user