Add wip solution to wasm_extern_as_ no allocation

This commit is contained in:
Mark McCaskey
2021-03-23 09:01:01 -07:00
parent 4026b3ab99
commit 9868c0f297
9 changed files with 148 additions and 39 deletions

View File

@@ -390,10 +390,7 @@ fn wasi_get_imports_inner(
}));
let inner = Extern::from_vm_export(store, export);
Some(Box::new(wasm_extern_t {
instance: None,
inner,
}))
Some(Box::new(inner.into()))
})
.collect::<Option<Vec<_>>>()?
.into();
@@ -407,10 +404,7 @@ pub unsafe extern "C" fn wasi_get_start_function(
) -> Option<Box<wasm_func_t>> {
let start = c_try!(instance.inner.exports.get_function("_start"));
Some(Box::new(wasm_func_t {
inner: start.clone(),
instance: Some(instance.inner.clone()),
}))
Some(Box::new(wasm_func_t::new(start.clone())))
}
#[cfg(test)]