fn instantiate_tables(
        &mut self,
        module: &Module,
        compilation: &Compilation,
        table_initializers: &[TableElements],
    ) {
        debug_assert!(self.tables.is_empty());
        self.tables.reserve_exact(module.tables.len());
        for table in &module.tables {
            let len = table.size;
            let mut v = Vec::with_capacity(len);
            v.resize(len, 0);
            self.tables.push(v);
        }
        for init in table_initializers {
            debug_assert!(init.base.is_none(), "globalvar base not supported yet");
            let to_init =
                &mut self.tables[init.table_index][init.offset..init.offset + init.elements.len()];
            for (i, func_idx) in init.elements.iter().enumerate() {
                let code_buf = &compilation.functions[*func_idx];
                to_init[i] = code_buf.as_ptr() as usize;
            }
        }
    }
/// Allocate memory in `self` for just the tables of the current module.
Allocate memory in `self` for just the tables of the current module.
Allocate memory in ` self ` for just the tables of the current module .
fn instantiate_tables(
        &mut self,
        module: &Module,
        compilation: &Compilation,
        table_initializers: &[TableElements],
    ) {
        debug_assert!(self.tables.is_empty());
        self.tables.reserve_exact(module.tables.len());
        for table in &module.tables {
            let len = table.size;
            let mut v = Vec::with_capacity(len);
            v.resize(len, 0);
            self.tables.push(v);
        }
        for init in table_initializers {
            debug_assert!(init.base.is_none(), "globalvar base not supported yet");
            let to_init =
                &mut self.tables[init.table_index][init.offset..init.offset + init.elements.len()];
            for (i, func_idx) in init.elements.iter().enumerate() {
                let code_buf = &compilation.functions[*func_idx];
                to_init[i] = code_buf.as_ptr() as usize;
            }
        }
    }
fn instantiate_tables ( & mut self , module : & Module , compilation : & Compilation , table_initializers : & [ TableElements ] , ) { debug_assert ! ( self tables is_empty ( ) ) ; self . tables . reserve_exact ( module . tables . len ( ) ) ; for table in & module . tables { let len = table . size ; let mut v = Vec :: with_capacity ( len ) ; v . resize ( len , 0 ) ; self . tables . push ( v ) ; } for init in table_initializers { debug_assert ! ( init base is_none ( ) " " ) ; let to_init = & mut self . tables [ init . table_index ] [ init . offset .. init . offset + init . elements . len ( ) ] ; for ( i , func_idx ) in init . elements . iter ( ) . enumerate ( ) { let code_buf = & compilation . functions [ * func_idx ] ; to_init [ i ] = code_buf . as_ptr ( ) as usize ; } } }
Allocate memory in `self` for just the tables of the current module.
Allocate memory in ` self ` for just the tables of the current module .
&mut self
module
&Module
compilation
&Compilation
table_initializers
&[TableElements]
&mut self
module
&Module
compilation
&Compilation
table_initializers
&[TableElements]