History log of /wasmtime-44.0.1/crates/wasmtime/src/runtime/types.rs (Results 1 – 25 of 59)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: dev, v36.0.9, v44.0.1, v43.0.2, v36.0.8, v24.0.8, v44.0.0, v43.0.1, v42.0.2, v36.0.7, v24.0.7
# 439de7fb 30-Mar-2026 Nick Fitzgerald <[email protected]>

Handle OOM in the rest of Wasmtime's non-component, -async, -compilation APIs (#12858)

* Handle OOM in more places in the public API

A bunch of random places:

* Add: `Trap::try_new` to handle OOM

Handle OOM in the rest of Wasmtime's non-component, -async, -compilation APIs (#12858)

* Handle OOM in more places in the public API

A bunch of random places:

* Add: `Trap::try_new` to handle OOM while creating traps
* Use: `TryVec` inside `Func::call_impl_do_call` and `wasm_val_raw_storage` to
hold the args and rets
* Add: `Instance::try_exports` for iterating over an instance's exports while
handling OOM
* `Linker:try_get`, like `Linker::get` but handling OOM
* `Linker:try_get_by_import`, like `Linker::get_by_import` but handling OOM
* Use `try_new` to box things in `SharedMemory::new`
* Use `TryVec` instead of `Vec` in our dynamic tables

* Add OOM tests for most of Wasmtime's public API

Excludes component-, async-, and compilation-related APIs.

* address review feedback

* fix test compilation

* fix c-api

show more ...


Revision tags: v43.0.0
# 183891f0 05-Mar-2026 Nick Fitzgerald <[email protected]>

Rename our OOM-handling `Vec` to `TryVec` (#12721)

* Rename our OOM-handling `Vec` to `TryVec`

* fix tests that got mangled by the LSP server

* fix more tests mangled by LSP


# 9872fefb 26-Feb-2026 Nick Fitzgerald <[email protected]>

Use `TryClone::clone_panic_on_oom` where it makes sense (#12681)


# 2b771588 26-Feb-2026 Nick Fitzgerald <[email protected]>

Add `TryClone` and `TryToOwned` to our prelude (#12676)

* Add `TryClone` and `TryToOwned` to our prelude

The non-`Try` versions are both in `std`'s prelude, so it makes sense to add
them to our pre

Add `TryClone` and `TryToOwned` to our prelude (#12676)

* Add `TryClone` and `TryToOwned` to our prelude

The non-`Try` versions are both in `std`'s prelude, so it makes sense to add
them to our prelude.

* fix warning

show more ...


# 25e3bd12 25-Feb-2026 Nick Fitzgerald <[email protected]>

Handle OOM in `wasmtime_environ::types::WasmFuncType` (#12670)

* Handle OOM in `wasmtime_environ::types::WasmFuncType`

It should also not `#[derive(Clone)]` anymore, just `TryClone`, which
propagat

Handle OOM in `wasmtime_environ::types::WasmFuncType` (#12670)

* Handle OOM in `wasmtime_environ::types::WasmFuncType`

It should also not `#[derive(Clone)]` anymore, just `TryClone`, which
propagates out to a bunch of other types as well.

And while we are here:

* Rename its "returns" to "results" to match Wasmtime's public API and also the
Wasm text format.
* Store both its params and results in a single allocation.
* Shrink its size on 64-bit architectures by storing its param- and
result-GC-type counts as `u32`s rather than `usize`s.

* fix clippy

* fix winch unit tests

show more ...


Revision tags: v42.0.1, v41.0.4, v42.0.0, v40.0.4, v36.0.6, v24.0.6
# b236888c 05-Feb-2026 Nick Fitzgerald <[email protected]>

Add `wasmtime::FuncType::try_new`, which propagates allocation failure (#12530)

Part of https://github.com/bytecodealliance/wasmtime/issues/12069


Revision tags: v41.0.3
# 9e3b5ee5 03-Feb-2026 Nick Fitzgerald <[email protected]>

Refactor the `TypeRegistry` to partially handle OOM (#12500)

* Refactor the `TypeRegistry` to partially handle OOM

This refactors the type registry to be more "columnar" when registering the
types

Refactor the `TypeRegistry` to partially handle OOM (#12500)

* Refactor the `TypeRegistry` to partially handle OOM

This refactors the type registry to be more "columnar" when registering the
types within a rec group, so that we

* Add all the types themselves
* Add the rec group metadata for all types in the rec group
* Add the supertypes metadata for all types in the rec group
* Etc...

Instead of adding one type, its rec group metadata, its supertypes metadata,
etc... and then moving on to the next type.

This makes it easier to pre-reserve space and roll back changes on OOM errors.

This is part of https://github.com/bytecodealliance/wasmtime/issues/12069 and
the OOM handling effort, but doesn't fully get the `TypeRegistry` to a place
where it handles all OOMs yet. There are a couple places that need further
work (usage of hash sets and `Cow::into_owned`) which I have marked with `TODO`
comments. In the meantime, I found this to be a nice refactoring of the existing
functionality, so I think it can land as-is.

* review feedback

show more ...


Revision tags: v41.0.2, v41.0.1, v36.0.5, v40.0.3, v41.0.0
# f947672a 14-Jan-2026 Zijie Zhao <[email protected]>

Fix HeadType::matches fallthrough for NoExn (#12350)


Revision tags: v36.0.4, v39.0.2, v40.0.2
# ff33e949 09-Jan-2026 Nick Fitzgerald <[email protected]>

Do not re-export `anyhow!` in the `wasmtime::prelude` (#12298)

We are trying to move to `format_err!` instead.


Revision tags: v40.0.1, v40.0.0, v39.0.1, v39.0.0
# 874da677 14-Nov-2025 Alex Crichton <[email protected]>

Fix `MemoryType::default_value` with shared memories (#12029)

* Fix `MemoryType::default_value` with shared memories

This fixes fallout from #12022 which was detected during fuzzing which
tried cre

Fix `MemoryType::default_value` with shared memories (#12029)

* Fix `MemoryType::default_value` with shared memories

This fixes fallout from #12022 which was detected during fuzzing which
tried creating a shared memory.

* Fix tests

show more ...


Revision tags: v38.0.4, v37.0.3, v36.0.3, v24.0.5, v38.0.3, v38.0.2, v38.0.1, v37.0.2, v37.0.1, v37.0.0, v36.0.2
# 41e71699 25-Aug-2025 Chris Fallin <[email protected]>

Exceptions: fix panic in `is_vmgcref_type()` for `HeapType::Exn`. (#11535)

* Exceptions: fix panic in `is_vmgcref_type()` for `HeapType::Exn`.

Fixes #11529 (for real this time).

* Add test.


# b7381778 25-Aug-2025 Chris Fallin <[email protected]>

Exceptions: support creating a default tag during fuzzing. (#11530)

Fixes #11528.


# c8e6b76c 25-Aug-2025 Block Pirate <[email protected]>

docs: fix typos (#11525)


Revision tags: v36.0.1, v36.0.0, v35.0.0, v24.0.4, v33.0.2, v34.0.2
# eaa4632e 15-Jul-2025 Chris Fallin <[email protected]>

Implement exception objects. (#11230)

* WIP: Working exception objects

* Clean build with gc disabled (`cargo check -p wasmtime --no-default-features --features runtime`).

* Review feedback.

* St

Implement exception objects. (#11230)

* WIP: Working exception objects

* Clean build with gc disabled (`cargo check -p wasmtime --no-default-features --features runtime`).

* Review feedback.

* Stub out C-API support.

* Fix Clippy complaints.

* Fix dead-code warning in c-api build.

* Actually fix 27->26 reserved bit rename and test.

* Fix exnref doc-test.

* fix fuzzing build

* fix feature-flagging on Instance::id

* Bless disas test diff due to reserved-bits change.

* Review feedback.

show more ...


# e6112173 08-Jul-2025 Shashi Shankar <[email protected]>

docs: add doc comments to default_value helpers (#10437) (#11200)


# 58e295ee 03-Jul-2025 Nick Fitzgerald <[email protected]>

Remove hash tables and bump chunk from the DRC collector (#11175)

* Remove hash tables and bump chunk from the DRC collector

This removes the explicit `HashSet`s used to represent the
over-approxim

Remove hash tables and bump chunk from the DRC collector (#11175)

* Remove hash tables and bump chunk from the DRC collector

This removes the explicit `HashSet`s used to represent the
over-approximated-stack-roots and precise-stack-roots sets and replaces them
with an intrusive, singly-linked list and a mark bit in the object headers
respectively. The new list implementation also subsumes the old bump chunk that
sat in front of the old over-approximated-stack-roots hash set.

This shaves off about 25% of the time it takes to run the test case in
https://github.com/bytecodealliance/wasmtime/issues/11141 for me locally.

This also ended up being a nice simplification of the DRC collector, which in
turn allowed us to further simplify the `GcHeap` trait, since we no longer ever
need to GC before passing GC refs into Wasm.

Fixes https://github.com/bytecodealliance/wasmtime/issues/11162

* Reorder memory operations when pushing onto the over-approximated-stack-roots list

* Address some more review feedback

* More review feedback

* Fix endianness issue with loading reserved bits

* Update disas tests after endianness fix

show more ...


Revision tags: v34.0.1, v33.0.1, v24.0.3, v32.0.1
# c81df203 24-Jun-2025 Alex Crichton <[email protected]>

Fix globals/tables holding their registered types (#11103)

This commit fixes an issue where host-created tables and globals with
concrete reference types previously did not keep their associated typ

Fix globals/tables holding their registered types (#11103)

This commit fixes an issue where host-created tables and globals with
concrete reference types previously did not keep their associated type
registrations alive for the duration of the table or global itself. This
could lead to runtime panics when reflecting on their type and
additionally lead to some type confusion about the global/table itself.
As described in #11102 this is not a security issue, just a bug that
needs fixing.

Closes #11102

show more ...


Revision tags: v34.0.0
# 63d482c8 04-Jun-2025 Frank Emrich <[email protected]>

Stack switching: Infrastructure and runtime support (#10388)

* [pr1] base

* prtest:full

* make sure to use ControlFlow result in trace_suspended_continuation

* stack-switching: cleanup: remove st

Stack switching: Infrastructure and runtime support (#10388)

* [pr1] base

* prtest:full

* make sure to use ControlFlow result in trace_suspended_continuation

* stack-switching: cleanup: remove stray c-api changes

These are remnants of unrelated wasmfx wasmtime experiments, possibly
suitable for later submission against upstream.

* stack-switching: reuse async_stack_size

* stack-switching: delete delete_me debugging

* stack-switching: address feedback in environ::types

* stack-switching: remove unused code from vmoffsets

* stack-switching: drop dependency on std

* stack-switching: add compilation checks to ci matrix

* stack-switching: remove debug_println cruft

* stack-switching: export environ consts consistently

* stack-switching: export vm pub items consistently

* table_pool: reduced capacity for large elements

VMContRef elements which takes up two words and we don't want to
double the size of all tables in order to support storing these.
This change changes the table to target storing the requested
max number of elements if they are "nominally" sized with
(potentially) reduced capacity for non-nominally sized types when
encountered.

Continuations are the only type of element which may result in
fewer table slots being available than requested.

* stack-switching: extend conditional compilation

A fair bit of the definitions for stack switching are still
enabled, but this patch takes things a bit further to avoid
compilation problems; notably, cont_new is now not compiled
in unless the feature is enabled.

* stack-switching: formatting fixes

* stack-switching: address new clippy checks

In addition, to get clippy to fully pass, plumbed in
additional config to make winch paths happy; there's no
impl for winch yet but plumbing through the feature is
required to make paths incorporating macros at various
layers satisfied (and it is expected we'll use the
features in the future).

* stack-switching: more conditional compilation fixes

* stack-switching: additional conditional compile on table builtins for continuations

* stack-switching: additional conditional compile fixes

* stack-switching: additional conditional compile in store

* stack-switching: remove overly strict assertion

* stack-switching: remove errantly dropped no_mangle in config c-api

* stack-switching: VMContObj::from_raw_parts

* stack-switching: remove duplicate async_stack_size feature check

* stack-switching: VMArray -> VMHostArray

* stack-switching: remove unnecessary clippy exception

* stack-switching: fix docs referenced VMRuntimeLimits

* stack-switching: fix doc typo

* stack-switching: follow recommendations for type casts

* stack-switching: use usize::next_multiple_of

* stack-switching: update outdated comment

* stack-switching: use feature gate instead of allow(dead_code)

* stack-switching: rework backtrace using chunks/zip

* stack-switching: move tests to footer module

This is a bit more consistent with the prevailing style
in tree and (subjectively) makes finding the tests
as a reader more straightforward.

Tests left unchanged sans some import cleanup.

* stack-swictchding: verify stack_chain offsets at runtime

* fixup! stack-switching: use feature gate instead of allow(dead_code)

* stack-switching: document continuation roots tracing using match arms

---------

Co-authored-by: Paul Osborne <[email protected]>

show more ...


# c4fd2f7b 02-Jun-2025 Alex Crichton <[email protected]>

Refactor globals to no longer use `Stored` (#10902)

This commit refactors the `wasmtime::Global` to avoid the usage of
`Stored<T>` internally. This makes conversion from internal global state
to ext

Refactor globals to no longer use `Stored` (#10902)

This commit refactors the `wasmtime::Global` to avoid the usage of
`Stored<T>` internally. This makes conversion from internal global state
to external global state a noop along the lines of previous commits. The
end goal is to remove `Stored` entirely and enable more pervasively using
external types internally within Wasmtime as well.

Globals were different than the prior iterations of memories, tags, and
tables. Globals have three different ways of defining them: wasm
instances, the host embedder, and component flags. Representing these
in all the various locations required a bit of finesse in how everything
is represented and stored at rest and such. In the end there's a small
amount of "type punning" in a few instance/vmctx fields related to
globals now since everything is squeezed into one slot. This is required
because the `VMGlobalImport` structure must have a size known to
wasm-compiled code and `wasmtime::Global` must have a known layout for C
code.

In the end while this is more code to manage globals my hope is that the
end result will be a net negative in terms of complexity by ensuring
that the embedder API is additionally suitable for use internally within
Wasmtime as well.

show more ...


Revision tags: v33.0.0
# 90ac295e 19-May-2025 Alex Crichton <[email protected]>

Update Wasmtime to the 2024 Rust Edition (#10806)

* Update Wasmtime to the 2024 Rust Edition

Now that our MSRV supports the 2024 edition it's possible to make this
switch. This commit moves Wasmtim

Update Wasmtime to the 2024 Rust Edition (#10806)

* Update Wasmtime to the 2024 Rust Edition

Now that our MSRV supports the 2024 edition it's possible to make this
switch. This commit moves Wasmtime to the 2024 Edition to keep
up-to-date with Rust idioms and access many of the edition features
exclusive to the 2024 edition.

prtest:full

* Reformat with the 2024 edition

show more ...


# cb484dd2 24-Apr-2025 Nick Fitzgerald <[email protected]>

Mark a handful of functions on the calling-into-Wasm path as `#[inline]` (#10643)

* Mark a handful of functions on the calling-into-Wasm path as `#[inline]`

This provides an improvement across the

Mark a handful of functions on the calling-into-Wasm path as `#[inline]` (#10643)

* Mark a handful of functions on the calling-into-Wasm path as `#[inline]`

This provides an improvement across the board for our `sync/no-hook` benchmarks:

<details>

<summary>Benchmark Results</summary>

```
$ cargo bench --profile profiling --bench call '\bsync/no-hook' -- --baseline main
Finished `profiling` profile [optimized + debuginfo] target(s) in 0.28s
Running benches/call.rs (target/profiling/deps/call-b0a2bedd3336ad76)
sync/no-hook/core - host-to-wasm - typed - nop
time: [27.334 ns 27.499 ns 27.668 ns]
change: [-16.388% -14.870% -13.479%] (p = 0.00 < 0.05)
Performance has improved.
Found 7 outliers among 100 measurements (7.00%)
5 (5.00%) high mild
2 (2.00%) high severe
sync/no-hook/core - host-to-wasm - untyped - nop
time: [44.141 ns 44.429 ns 44.757 ns]
change: [-18.380% -17.041% -15.670%] (p = 0.00 < 0.05)
Performance has improved.
Found 3 outliers among 100 measurements (3.00%)
1 (1.00%) high mild
2 (2.00%) high severe
sync/no-hook/core - host-to-wasm - unchecked - nop
time: [29.731 ns 29.983 ns 30.262 ns]
change: [-25.104% -22.176% -19.159%] (p = 0.00 < 0.05)
Performance has improved.
Found 7 outliers among 100 measurements (7.00%)
5 (5.00%) high mild
2 (2.00%) high severe
sync/no-hook/core - host-to-wasm - typed - nop-params-and-results
time: [28.990 ns 29.143 ns 29.303 ns]
change: [-25.804% -24.562% -23.372%] (p = 0.00 < 0.05)
Performance has improved.
Found 6 outliers among 100 measurements (6.00%)
3 (3.00%) high mild
3 (3.00%) high severe
sync/no-hook/core - host-to-wasm - untyped - nop-params-and-results
time: [110.00 ns 110.65 ns 111.46 ns]
change: [-11.967% -9.0070% -6.1347%] (p = 0.00 < 0.05)
Performance has improved.
Found 7 outliers among 100 measurements (7.00%)
2 (2.00%) high mild
5 (5.00%) high severe
sync/no-hook/core - host-to-wasm - unchecked - nop-params-and-results
time: [58.828 ns 59.089 ns 59.418 ns]
change: [-15.596% -13.573% -11.484%] (p = 0.00 < 0.05)
Performance has improved.
Found 3 outliers among 100 measurements (3.00%)
3 (3.00%) high severe

sync/no-hook/core - wasm-to-host - typed - nop
time: [6.6209 ns 6.6615 ns 6.7077 ns]
change: [-53.555% -52.878% -52.116%] (p = 0.00 < 0.05)
Performance has improved.
Found 6 outliers among 100 measurements (6.00%)
5 (5.00%) high mild
1 (1.00%) high severe
sync/no-hook/core - wasm-to-host - typed - nop-params-and-results
time: [7.9783 ns 8.0173 ns 8.0611 ns]
change: [-54.341% -53.947% -53.505%] (p = 0.00 < 0.05)
Performance has improved.
Found 3 outliers among 100 measurements (3.00%)
3 (3.00%) high severe
sync/no-hook/core - wasm-to-host - untyped - nop
time: [18.306 ns 18.393 ns 18.491 ns]
change: [-29.104% -28.127% -27.171%] (p = 0.00 < 0.05)
Performance has improved.
Found 7 outliers among 100 measurements (7.00%)
3 (3.00%) high mild
4 (4.00%) high severe
sync/no-hook/core - wasm-to-host - untyped - nop-params-and-results
time: [67.741 ns 68.120 ns 68.601 ns]
change: [-26.453% -25.061% -23.663%] (p = 0.00 < 0.05)
Performance has improved.
Found 12 outliers among 100 measurements (12.00%)
6 (6.00%) high mild
6 (6.00%) high severe
sync/no-hook/core - wasm-to-host - unchecked - nop
time: [6.8379 ns 6.8915 ns 6.9566 ns]
change: [-55.623% -55.062% -54.481%] (p = 0.00 < 0.05)
Performance has improved.
Found 7 outliers among 100 measurements (7.00%)
5 (5.00%) high mild
2 (2.00%) high severe
sync/no-hook/core - wasm-to-host - unchecked - nop-params-and-results
time: [27.856 ns 28.024 ns 28.214 ns]
change: [-17.320% -16.103% -15.038%] (p = 0.00 < 0.05)
Performance has improved.
Found 10 outliers among 100 measurements (10.00%)
6 (6.00%) high mild
4 (4.00%) high severe

sync/no-hook/component - host-to-wasm - typed - nop
time: [55.126 ns 55.506 ns 55.932 ns]
change: [-19.458% -18.098% -16.736%] (p = 0.00 < 0.05)
Performance has improved.
Found 8 outliers among 100 measurements (8.00%)
2 (2.00%) high mild
6 (6.00%) high severe
sync/no-hook/component - host-to-wasm - untyped - nop
time: [101.42 ns 102.06 ns 102.82 ns]
change: [-15.679% -14.108% -12.523%] (p = 0.00 < 0.05)
Performance has improved.
Found 9 outliers among 100 measurements (9.00%)
7 (7.00%) high mild
2 (2.00%) high severe
sync/no-hook/component - host-to-wasm - typed - nop-params-and-results
time: [61.482 ns 62.017 ns 62.591 ns]
change: [-16.576% -15.100% -13.595%] (p = 0.00 < 0.05)
Performance has improved.
Found 10 outliers among 100 measurements (10.00%)
9 (9.00%) high mild
1 (1.00%) high severe
sync/no-hook/component - host-to-wasm - untyped - nop-params-and-results
time: [223.50 ns 224.72 ns 226.05 ns]
change: [-21.732% -20.178% -18.679%] (p = 0.00 < 0.05)
Performance has improved.
Found 4 outliers among 100 measurements (4.00%)
1 (1.00%) high mild
3 (3.00%) high severe

sync/no-hook/component - wasm-to-host - typed - nop
time: [39.115 ns 39.295 ns 39.500 ns]
change: [-15.139% -13.886% -12.721%] (p = 0.00 < 0.05)
Performance has improved.
Found 8 outliers among 100 measurements (8.00%)
1 (1.00%) low mild
2 (2.00%) high mild
5 (5.00%) high severe
sync/no-hook/component - wasm-to-host - typed - nop-params-and-results
time: [47.234 ns 47.458 ns 47.745 ns]
change: [-13.833% -11.951% -9.8784%] (p = 0.00 < 0.05)
Performance has improved.
Found 9 outliers among 100 measurements (9.00%)
3 (3.00%) high mild
6 (6.00%) high severe
sync/no-hook/component - wasm-to-host - untyped - nop
time: [52.311 ns 52.556 ns 52.817 ns]
change: [-12.736% -11.712% -10.693%] (p = 0.00 < 0.05)
Performance has improved.
Found 9 outliers among 100 measurements (9.00%)
4 (4.00%) high mild
5 (5.00%) high severe
sync/no-hook/component - wasm-to-host - untyped - nop-params-and-results
time: [239.71 ns 241.59 ns 244.11 ns]
change: [-29.804% -28.173% -26.415%] (p = 0.00 < 0.05)
Performance has improved.
Found 9 outliers among 100 measurements (9.00%)
4 (4.00%) high mild
5 (5.00%) high severe
```

</details>

* remove inline(never) on interpreter method

* Remove `#[inline]` from larger methods

show more ...


Revision tags: v32.0.0
# 5279f5c3 15-Apr-2025 Alex Crichton <[email protected]>

Don't discard errors in `default_value` helpers (#10584)

This commit updates the `default_value` helpers added recently to return
a `Result` instead of returning an `Option<T>` and throwing away err

Don't discard errors in `default_value` helpers (#10584)

This commit updates the `default_value` helpers added recently to return
a `Result` instead of returning an `Option<T>` and throwing away error
information. This fixes a fuzz bug showing up recently which happened
because the error in question was one we've flagged to ignore, but
because the error was discarded we didn't know to ignore it so it ended
up causing a fuzz failure.

show more ...


# df4cb6eb 02-Apr-2025 Gonzalo Silvalde <[email protected]>

Expose default value constructors for Wasm types in host API (#10500)

* Expose default value constructors for Wasm types in host API

* Added doc comments


# dfaba60a 20-Mar-2025 Nick Fitzgerald <[email protected]>

Make `RegisteredType::root` panic when given bad type indices (#10434)

Rather than returning `None`.

All callers were unwrapping anyways, and if we ever hit this, it is really a bug
in our code rat

Make `RegisteredType::root` panic when given bad type indices (#10434)

Rather than returning `None`.

All callers were unwrapping anyways, and if we ever hit this, it is really a bug
in our code rather than an expected edge case we need to handle.

show more ...


Revision tags: v31.0.0
# 1e5d77d6 28-Feb-2025 shenpengfeng <[email protected]>

chore: fix some typos in comments (#10309)

Signed-off-by: shenpengfeng <[email protected]>


123