Skip to content

Commit 31f4507

Browse files
authored
Do not allocate for wasmtime::Module::imports iterator (#12682)
* Do not allocate for `wasmtime::Module::imports` iterator * Revert "Do not allocate for `wasmtime::Module::imports` iterator" This reverts commit d10da00. * review feedback
1 parent 9872fef commit 31f4507

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

crates/wasmtime/src/runtime/module.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -755,14 +755,10 @@ impl Module {
755755
let module = self.compiled_module().module();
756756
let types = self.types();
757757
let engine = self.engine();
758-
module
759-
.imports()
760-
.map(move |(imp_mod, imp_field, ty)| {
761-
debug_assert!(ty.is_canonicalized_for_runtime_usage());
762-
ImportType::new(imp_mod, imp_field, ty, types, engine)
763-
})
764-
.collect::<Vec<_>>()
765-
.into_iter()
758+
module.imports().map(move |(imp_mod, imp_field, ty)| {
759+
debug_assert!(ty.is_canonicalized_for_runtime_usage());
760+
ImportType::new(imp_mod, imp_field, ty, types, engine)
761+
})
766762
}
767763

768764
/// Returns the list of exports that this [`Module`] has and will be

0 commit comments

Comments
 (0)