1use crate::interpreter::Memory;
4
5#[cfg(any(test, feature = "test-helpers"))]
6use crate::interpreter::MemoryInstance;
7
8pub trait VmMemoryPool: Sync {
10 type Memory: Memory + Send + Sync + 'static;
12
13 fn get_new(&self) -> impl core::future::Future<Output = Self::Memory> + Send;
15}
16
17#[cfg(any(test, feature = "test-helpers"))]
19#[derive(Default, Clone)]
20pub struct DummyPool;
21
22#[cfg(any(test, feature = "test-helpers"))]
23impl VmMemoryPool for DummyPool {
24 type Memory = MemoryInstance;
25
26 fn get_new(&self) -> impl core::future::Future<Output = Self::Memory> + Send {
27 core::future::ready(MemoryInstance::new())
28 }
29}