diff options
| author | Henry Gressmann <mail@henrygressmann.de> | 2026-08-24 15:47:05 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-08-24 15:47:05 +0200 |
| commit | 7b9b3ec681e68280399d9c67e01433c2d3acb6c2 (patch) | |
| tree | b6000a9755d50fe1ba6f93de6ed784deb179ae49 /examples/simple.rs | |
| parent | 3e2e964f70e6128b891fa3b43f73a821493bd7bc (diff) | |
feat: add host typed reference / gc APIs (#54)
- add Store-aware handles for references, GC objects, and exceptions
- simplify host value conversion, rooting, and exception propagation
- update examples, tests, and documentation
- Remove deprecated APIs
Signed-off-by: Henry <mail@henrygressmann.de>
Diffstat (limited to 'examples/simple.rs')
| -rw-r--r-- | examples/simple.rs | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/examples/simple.rs b/examples/simple.rs deleted file mode 100644 index 0d57265..0000000 --- a/examples/simple.rs +++ /dev/null @@ -1,22 +0,0 @@ -use anyhow::Result; -use tinywasm::{ModuleInstance, Store}; - -const WASM: &str = r#" -(module - (func $add (param $lhs i32) (param $rhs i32) (result i32) - local.get $lhs - local.get $rhs - i32.add) - (export "add" (func $add))) -"#; - -fn main() -> Result<()> { - let wasm = wat::parse_str(WASM).expect("failed to parse wat"); - let module = tinywasm::parse_bytes(&wasm)?; - let mut store = Store::default(); - let instance = ModuleInstance::instantiate(&mut store, &module, None)?; - let add = instance.func::<(i32, i32), i32>(&store, "add")?; - - assert_eq!(add.call(&mut store, (1, 2))?, 3); - Ok(()) -} |
