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/simple2.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/simple2.rs')
| -rw-r--r-- | examples/simple2.rs | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/examples/simple2.rs b/examples/simple2.rs deleted file mode 100644 index f673dfe..0000000 --- a/examples/simple2.rs +++ /dev/null @@ -1,21 +0,0 @@ -use anyhow::Result; -use tinywasm::{ModuleInstance, Store}; - -const WASM: &str = r#" -(module - (func $return (param $lhs i32) (param $rhs i64) (result i32 i64) - local.get $lhs - local.get $rhs) - (export "return" (func $return))) -"#; - -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, i64), (i32, i64)>(&store, "return")?; - - assert_eq!(add.call(&mut store, (1, 2))?, (1, 2)); - Ok(()) -} |
