You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 8951dc7
Browse filesBrowse the repository at this point in the historyBrowse files
feat: write function results into caller-provided slices
- update dynamic calls, host functions, docs, tests, CLI, and benchmarks
- reuse result buffers and validate parameter and result arity
- fix 32-bit GC array traps and WAST failure output
Signed-off-by: Henry <mail@henrygressmann.de>
- Added `ValueLane` for mapping WebAssembly value types to their physical 32-bit, 64-bit, or 128-bit storage lane.
18
-
- Added a `validate` feature to `tinywasm` and `tinywasm-parser` (enabled by default) to optionally skip wasmparser validation for faster parsing of trusted modules.
19
-
- Added optional parse-time operand deduplication to reduce precompiled module and `.twasm` archive size.
20
-
- Added a `ResourceLimiter` trait, configurable through `engine::Config::with_resource_limiter`, to bound guest memory, table, and logical GC heap growth.
21
-
- Added Store-aware owned references, explicit GC collection, and typed host access to GC objects and exceptions.
12
+
- Support for the function-references, garbage-collection, exception-handling, and compact-imports proposals.
13
+
- Store-aware owned references, explicit GC collection, and typed host access to GC objects and exceptions.
14
+
-`WasmValue::ty`, `WasmValue::matches_type`, and `ValueLane` for inspecting value types and storage lanes.
15
+
-`ResourceLimiter` for limiting guest memory, table, and logical GC heap growth.
16
+
- A default `validate` Cargo feature that can be disabled when parsing trusted modules.
17
+
- Optional parse-time operand deduplication for smaller `.twasm` archives.
22
18
23
19
### Changed
24
20
25
-
-`HostFunction` is now a reusable definition, and module instantiation borrows `Imports` so host imports can be shared across stores.
26
-
- Host function callbacks now require `Send + Sync` so the same definition can be used safely with multiple stores.
27
-
- Typed function tuples now support up to 20 parameters or results. Use untyped functions for larger signatures.
28
-
- Module types now use one dense recursive type space, while function types are resolved through `Function::ty(&Store)`.
29
-
- Globals are stored in separate 32-bit, 64-bit, and 128-bit value lanes, avoiding tagged value conversion during guest execution.
30
-
- Linear memory now uses a single contiguous `Vec`-backed storage with const-generic fixed-width loads and stores.
31
-
- Exceptions are stored as traced managed objects, allowing unreachable exceptions and their payload graphs to be collected.
32
-
- Increased the minimum supported Rust version from 1.95 to 1.98.
21
+
- Typed functions support tuples up to arity 20 and `[u8; 16]` values for `v128`.
22
+
- Module types use one recursive type space, with runtime function types available through `Function::ty(&Store)`.
23
+
- Linear memory uses contiguous `Vec`-backed storage.
24
+
- The minimum supported Rust version is 1.98.
33
25
34
26
### Fixed
35
27
@@ -41,23 +33,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
41
33
42
34
### Breaking Changes
43
35
44
-
-`HostFunction::from` and `HostFunction::from_untyped` no longer take a `Store` and now return reusable `HostFunction` definitions
45
-
-`ModuleInstance::instantiate` and `instantiate_no_start` now borrow `Imports`.
46
-
-`Store::id` now returns `u32` instead of `usize`.
47
-
-`Parser::new` now takes `ParserOptions`, use `Parser::default()` for default settings. `Parser::with_options` was removed.
48
-
- Renamed `ModuleInstanceAddr` to `ModuleInstanceId`.
49
-
- Removed `HostFunction::ty` and `WasmFunction::ty`. Use `Function::ty(&Store)` for runtime function types.
50
-
- Changed `TableType::element_type` and `Element::ty` from `WasmType` to `RefType`, and replaced module `table_types` with `TableDefinition { ty, init }`.
51
-
- Removed the pluggable memory backend system (`LinearMemory`, `MemoryBackend`, `VecMemory`, `PagedMemory`, `LazyLinearMemory`, and `Config::with_memory_backend`). Linear memory is always `Vec`-backed. To limit initial memory allocation and growth, configure a `ResourceLimiter` with `Config::with_resource_limiter`.
52
-
- Removed the local-memory allocation analysis (`LocalMemoryAllocation` and `ParserOptions::optimize_local_memory_allocation`). Local memories are always allocated eagerly.
53
-
- Removed `Config::with_trap_on_oom`. A `ResourceLimiter` can return a trap when rejecting a memory or table allocation or growth request.
54
-
-`Table::grow` now returns `Result<Option<usize>>`, matching `Memory::grow`. Growth limits and allocation failures return `None`, while limiter-provided traps return an error.
55
-
- Public function and managed references are Store-aware. Managed references such as `StructRef`, `ArrayRef`, `ExternRef`, and `ExnRef` are owned handles that keep their referents live until the last clone is dropped.
56
-
-`ExternRef::try_new` and `I31Ref::try_new` create host references. Reference data and GC object access are provided by inherent methods on each reference type.
57
-
- Renamed the fallible `Memory`, `Table`, `Global`, and `Tag` constructors from `new` to `try_new`.
58
-
-`WasmValue` is no longer `Copy` because it can contain owned references.
59
-
- Nullable typed reference parameters and results use `Option<T>`. Bare typed reference values are non-null.
60
-
- Removed `WasmTupleChain`. Use direct tuples up to arity 20 or untyped functions for larger signatures.
36
+
- Dynamic `Function::call` and `Function::call_resumable` calls write to caller-provided result slices. Untyped host callbacks also receive a result slice and return `Result<()>`.
37
+
-`HostFunction` definitions are reusable, require `Send + Sync`, and no longer take a `Store`.
38
+
- Module instantiation borrows `Imports`, allowing imports to be shared across stores.
39
+
-`HostFunction::ty` and `WasmFunction::ty` were removed. Use `Function::ty(&Store)` for runtime types.
40
+
- Function and managed reference handles are Store-aware. Managed references keep their referents live, and `WasmValue` is no longer `Copy`.
41
+
- Nullable typed reference parameters and results use `Option<T>`. Bare typed references are non-null.
42
+
- Host references are created with `ExternRef::try_new` and `I31Ref::try_new`. Reference and GC object access is provided by methods on each reference type.
43
+
- Fallible `Memory`, `Table`, `Global`, and `Tag` constructors are named `try_new`.
44
+
-`Store::id` returns `u32`, and `ModuleInstanceAddr` is renamed to `ModuleInstanceId`.
45
+
- Table element types use `RefType`, and module table definitions use `TableDefinition { ty, init }`.
46
+
-`Parser::new` takes `ParserOptions`. Use `Parser::default()` for default settings. `Parser::with_options` and local-memory allocation analysis were removed.
47
+
- Pluggable memory backends and `Config::with_trap_on_oom` were removed. Linear memory is always `Vec`-backed, and allocation limits use `ResourceLimiter`.
0 commit comments