Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance support for scripted language bindings by making Imports and Module cloneable #9

Merged
merged 1 commit into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ examples/rust/Cargo.lock
examples/wast/*
perf.*
flamegraph.svg
/.idea
/*.iml
7 changes: 4 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions crates/tinywasm/src/imports.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>,
Expand Down
1 change: 1 addition & 0 deletions crates/tinywasm/src/module.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
Expand Down