Skip to content
This repository was archived by the owner on Oct 3, 2025. It is now read-only.

Commit acb91b8

Browse files
feat: make Imports and Module cloneable (#9)
Fixes #10.
1 parent 735c7cb commit acb91b8

File tree

4 files changed

+8
-3
lines changed

4 files changed

+8
-3
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@ examples/rust/Cargo.lock
66
examples/wast/*
77
perf.*
88
flamegraph.svg
9+
/.idea
10+
/*.iml

CHANGELOG.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1212
### Changed
1313

1414
- Improved documentation and added more tests
15+
- Enhance support for scripted language bindings by making Imports and Module cloneable
1516

1617
### Removed
1718

@@ -31,7 +32,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3132
- Reduced the overhead of control flow instructions
3233
- Reduced the size of bytecode instructions
3334
- Fixed issues on the latest nightly Rust compiler
34-
- Simpliefied a lot of the internal macros
35+
- Simplified a lot of the internal macros
3536

3637
### Removed
3738

@@ -75,8 +76,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7576
**All Commits**: https://github.com/explodingcamera/tinywasm/compare/v0.1.0...v0.2.0
7677

7778
- Support for br_table
78-
- Memory trapping improvments
79-
- Implicit function lable scopes
79+
- Memory trapping improvements
80+
- Implicit function label scopes
8081
- else Instructions
8182
- All Memory instructions
8283
- Imports

crates/tinywasm/src/imports.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ impl From<&Import> for ExternName {
218218
///
219219
/// Note that module instance addresses for [`Imports::link_module`] can be obtained from [`crate::ModuleInstance::id`].
220220
/// Now, the imports object can be passed to [`crate::ModuleInstance::instantiate`].
221+
#[derive(Clone)]
221222
pub struct Imports {
222223
values: BTreeMap<ExternName, Extern>,
223224
modules: BTreeMap<String, ModuleInstanceAddr>,

crates/tinywasm/src/module.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ use tinywasm_types::TinyWasmModule;
55
/// A WebAssembly Module
66
///
77
/// See <https://webassembly.github.io/spec/core/syntax/modules.html#syntax-module>
8+
#[derive(Clone)]
89
pub struct Module {
910
pub(crate) data: TinyWasmModule,
1011
}

0 commit comments

Comments
 (0)