Restructure VMContext to eliminate a level of indirection.

This commit is contained in:
Dan Gohman
2019-01-03 11:02:37 -08:00
parent ff6776fe10
commit 3270369a69
10 changed files with 774 additions and 621 deletions

View File

@@ -159,7 +159,7 @@ impl CompiledModule {
/// Note that if only one instance of this module is needed, it may be more
/// efficient to call the top-level `instantiate`, since that avoids copying
/// the data initializers.
pub fn instantiate(&mut self) -> Result<Box<Instance>, InstantiationError> {
pub fn instantiate(&mut self) -> Result<Instance, InstantiationError> {
let data_initializers = self
.data_initializers
.iter()
@@ -205,7 +205,7 @@ pub fn instantiate(
compiler: &mut Compiler,
data: &[u8],
resolver: &mut Resolver,
) -> Result<Box<Instance>, SetupError> {
) -> Result<Instance, SetupError> {
let raw = RawCompiledModule::new(compiler, data, resolver)?;
Instance::new(