Add memories to the store, returning their addresses in the store
(&mut self, memories: &[MemoryType])
| 346 | |
| 347 | /// Add memories to the store, returning their addresses in the store |
| 348 | pub(crate) fn init_memories(&mut self, memories: &[MemoryType]) -> Result<impl ExactSizeIterator<Item = MemAddr>> { |
| 349 | let start = self.state.memories.len() as MemAddr; |
| 350 | self.state.memories.reserve_exact(memories.len()); |
| 351 | for &mem in memories { |
| 352 | self.state.memories.push(MemoryInstance::new(mem, &self.engine.config().memory_backend)?); |
| 353 | } |
| 354 | Ok(start..start + memories.len() as MemAddr) |
| 355 | } |
| 356 | |
| 357 | pub(crate) fn init_lazy_memories( |
| 358 | &mut self, |
no test coverage detected