some minor improvements

This commit is contained in:
vms
2020-04-29 23:15:38 +03:00
parent 0cba64b538
commit abed2c238a
7 changed files with 8 additions and 18 deletions

View File

@ -54,6 +54,7 @@ impl IsExport for Export {
/// n
/// }
/// ```
#[derive(Clone)]
pub struct ImportObject {
map: Arc<Mutex<HashMap<String, Box<dyn LikeNamespace + Send>>>>,
pub(crate) state_creator:
@ -158,15 +159,6 @@ impl ImportObject {
.and_then(|ns| f(ns))
}
/// Create a clone ref of this namespace.
pub fn clone_ref(&self) -> Self {
Self {
map: Arc::clone(&self.map),
state_creator: self.state_creator.clone(),
allow_missing_functions: false,
}
}
fn get_objects(&self) -> VecDeque<(String, String, Export)> {
let mut out = VecDeque::new();
let guard = self.map.lock().unwrap();

View File

@ -103,7 +103,7 @@ impl Instance {
module,
inner,
exports,
import_object: imports.clone_ref(),
import_object: imports.clone(),
};
if let Some(start_index) = instance.module.info.start_func {