MCPcopy Create free account
hub / github.com/explodingcamera/tinywasm / get_tables_mut

Method get_tables_mut

crates/tinywasm/src/store/mod.rs:218–230  ·  view source on GitHub ↗

Get two mutable tables at the actual index in the store

(
        &mut self,
        addr: TableAddr,
        addr2: TableAddr,
    )

Source from the content-addressed store, hash-verified

216
217 /// Get two mutable tables at the actual index in the store
218 pub(crate) fn get_tables_mut(
219 &mut self,
220 addr: TableAddr,
221 addr2: TableAddr,
222 ) -> (&mut TableInstance, &mut TableInstance) {
223 match self.tables.get_disjoint_mut([addr as usize, addr2 as usize]) {
224 Ok([table_a, table_b]) => (table_a, table_b),
225 Err(_) => {
226 cold_path();
227 unreachable!("table {addr} or {addr2} not found. This should be unreachable")
228 }
229 }
230 }
231
232 /// Get the data at the actual index in the store
233 pub(crate) fn get_data_mut(&mut self, addr: DataAddr) -> &mut DataInstance {

Callers 1

exec_table_copyMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected