Create a new store
(engine: Engine)
| 65 | impl Store { |
| 66 | /// Create a new store |
| 67 | pub fn new(engine: Engine) -> Self { |
| 68 | let id = STORE_ID.fetch_add(1, Ordering::Relaxed); |
| 69 | Self { |
| 70 | id, |
| 71 | module_instances: Vec::new(), |
| 72 | state: State::default(), |
| 73 | call_stack: CallStack::new(engine.config()), |
| 74 | value_stack: ValueStack::new(engine.config()), |
| 75 | engine, |
| 76 | execution_fuel: 0, |
| 77 | execution_active: false, |
| 78 | } |
| 79 | } |
| 80 | |
| 81 | /// Get a module instance by the internal id |
| 82 | pub fn get_module_instance(&self, addr: ModuleInstanceAddr) -> Option<ModuleInstance> { |