Skip to content

Commit

Permalink
chore(deps): update wasm-encoder requirement from 0.202.0 to 0.203.0 (#…
Browse files Browse the repository at this point in the history
…20)

* chore(deps): update wasm-encoder requirement from 0.202.0 to 0.203.0

---
updated-dependencies:
- dependency-name: wasm-encoder
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>

* chore: add shared parameter for GlobalType

* chore: cleanup gc example

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: zach <[email protected]>
  • Loading branch information
dependabot[bot] and zshipko authored Apr 15, 2024
1 parent 79909c9 commit 6256ede
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 11 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[package]
name = "wagen"
version = "0.1.0"
version = "0.2.0"
edition = "2021"
repository = "https://github.com/dylibso/wagen"
license = "BSD-3-Clause"
description = "A library to help generate WebAssembly"

[dependencies]
anyhow = "1.0.71"
wasm-encoder = {version = "0.202.0", features = ["wasmparser"]}
wasm-encoder = {version = "0.203.0", features = ["wasmparser"]}
wasmparser = {version = "0.203.0"}
extism-manifest = {version = "1", optional = true}
extism = {version = "1", optional = true}
Expand Down
18 changes: 9 additions & 9 deletions examples/gc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,30 +30,30 @@ impl<'a> Expr<'a> for Add {
fn expr(self, builder: &mut Builder<'a>) {
builder.push([
// Set a field
Instr::LocalGet(0),
Instr::LocalGet(0),
Instr::LocalGet(self.0.index()),
Instr::LocalGet(self.0.index()),
Instr::StructGet {
struct_type_index: self.0.index(),
struct_type_index: self.2.index(),
field_index: 0,
},
Instr::LocalGet(1),
Instr::LocalGet(self.1.index()),
Instr::StructGet {
struct_type_index: self.0.index(),
struct_type_index: self.2.index(),
field_index: 0,
},
Instr::I32Add,
Instr::StructSet {
struct_type_index: self.0.index(),
struct_type_index: self.2.index(),
field_index: 0,
},
// Set b field
Instr::LocalGet(0),
Instr::LocalGet(0),
Instr::LocalGet(self.0.index()),
Instr::LocalGet(self.0.index()),
Instr::StructGet {
struct_type_index: self.0.index(),
field_index: 1,
},
Instr::LocalGet(1),
Instr::LocalGet(self.1.index()),
Instr::StructGet {
struct_type_index: self.0.index(),
field_index: 1,
Expand Down
1 change: 1 addition & 0 deletions examples/hello.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ fn main() {
let extism = module.link_extism();

module.memory(MemoryType {
page_size_log2: None,
minimum: 1,
maximum: None,
memory64: false,
Expand Down
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,10 +234,12 @@ impl<'a> Module<'a> {
name: impl AsRef<str>,
ty: ValType,
mutable: bool,
shared: bool,
init: &ConstExpr,
) -> &mut Global {
self.globals.global(
wasm_encoder::GlobalType {
shared,
val_type: ty,
mutable,
},
Expand Down

0 comments on commit 6256ede

Please sign in to comment.