Let the runtime provide the number of imported functions.

This obviates the need to keep a separate running total of the number of
functions seen.
This commit is contained in:
Dan Gohman
2017-10-09 11:41:01 -07:00
parent e74bc06380
commit 2c9d03f9bd
4 changed files with 10 additions and 5 deletions

View File

@@ -159,6 +159,9 @@ pub trait WasmRuntime: FuncEnvironment {
/// Declares a function import to the runtime.
fn declare_func_import(&mut self, sig_index: SignatureIndex, module: &[u8], field: &[u8]);
/// Return the number of imported funcs.
fn get_num_func_imports(&self) -> usize;
/// Declares the type (signature) of a local function in the module.
fn declare_func_type(&mut self, sig_index: SignatureIndex);