Add misc clean ups and corrections

This commit is contained in:
Mark McCaskey
2020-11-18 14:23:40 -08:00
parent 15e88a1195
commit 85169f6996
5 changed files with 38 additions and 50 deletions

View File

@@ -101,6 +101,7 @@ pub unsafe extern "C" fn wasm_func_new_with_env(
let func_sig = &function_type.inner().function_type;
let num_rets = func_sig.results().len();
#[derive(wasmer::WasmerEnv)]
#[repr(C)]
struct WrapperEnv {
env: *mut c_void,
@@ -115,15 +116,6 @@ pub unsafe extern "C" fn wasm_func_new_with_env(
}
}
impl wasmer::WasmerEnv for WrapperEnv {
fn init_with_instance(
&mut self,
_instance: &wasmer::Instance,
) -> Result<(), wasmer::HostEnvInitError> {
Ok(())
}
}
let inner_callback =
move |env: &mut WrapperEnv, args: &[Val]| -> Result<Vec<Val>, RuntimeError> {
let processed_args: wasm_val_vec_t = args