summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore2
-rw-r--r--CHANGELOG.md7
-rw-r--r--crates/tinywasm/src/imports.rs1
-rw-r--r--crates/tinywasm/src/module.rs1
4 files changed, 8 insertions, 3 deletions
diff --git a/.gitignore b/.gitignore
index d2fbb51..1ae1f15 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,3 +6,5 @@ examples/rust/Cargo.lock
examples/wast/*
perf.*
flamegraph.svg
+/.idea
+/*.iml
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9f06127..84815c2 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
- Improved documentation and added more tests
+- Enhance support for scripted language bindings by making Imports and Module cloneable
### Removed
@@ -31,7 +32,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Reduced the overhead of control flow instructions
- Reduced the size of bytecode instructions
- Fixed issues on the latest nightly Rust compiler
-- Simpliefied a lot of the internal macros
+- Simplified a lot of the internal macros
### Removed
@@ -75,8 +76,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
**All Commits**: https://github.com/explodingcamera/tinywasm/compare/v0.1.0...v0.2.0
- Support for br_table
-- Memory trapping improvments
-- Implicit function lable scopes
+- Memory trapping improvements
+- Implicit function label scopes
- else Instructions
- All Memory instructions
- Imports
diff --git a/crates/tinywasm/src/imports.rs b/crates/tinywasm/src/imports.rs
index 1c5ca98..949c5fe 100644
--- a/crates/tinywasm/src/imports.rs
+++ b/crates/tinywasm/src/imports.rs
@@ -218,6 +218,7 @@ impl From<&Import> for ExternName {
///
/// Note that module instance addresses for [`Imports::link_module`] can be obtained from [`crate::ModuleInstance::id`].
/// Now, the imports object can be passed to [`crate::ModuleInstance::instantiate`].
+#[derive(Clone)]
pub struct Imports {
values: BTreeMap<ExternName, Extern>,
modules: BTreeMap<String, ModuleInstanceAddr>,
diff --git a/crates/tinywasm/src/module.rs b/crates/tinywasm/src/module.rs
index 08e76da..5b5f0c6 100644
--- a/crates/tinywasm/src/module.rs
+++ b/crates/tinywasm/src/module.rs
@@ -5,6 +5,7 @@ use tinywasm_types::TinyWasmModule;
/// A WebAssembly Module
///
/// See <https://webassembly.github.io/spec/core/syntax/modules.html#syntax-module>
+#[derive(Clone)]
pub struct Module {
pub(crate) data: TinyWasmModule,
}