Stream: git-wasmtime

Topic: wasmtime / PR #10872 Store an `InstanceId` in `vm::Instance`


view this post on Zulip Wasmtime GitHub notifications bot (May 30 2025 at 19:24):

alexcrichton opened PR #10872 from alexcrichton:instance-id-in-instance to bytecodealliance:main:

This commit is the beginning of an effort to clean up unsafe-related code about how we manage instances in the guts of Wasmtime. This doesn't have any affect on the public API but it's will result eventually in changes to the internals of types in the public API. This change is also done in preparation for simplifying Stored<T> and how it works in Wasmtime to avoid requiring allocations (aka pushing onto a StoreData vector) when converting from Wasmtime's internal representation to the external representation of tables, globals, memories, etc.

For now all this commit does is add id: InstanceId to the vm::Instance structure. This led to some refactorings to ensure that it's correctly listed by centralizing various methods to allocate an instance into one helper method which manages this configuration.

<!--
Please make sure you include the following information:

Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.html

Please ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->

view this post on Zulip Wasmtime GitHub notifications bot (May 30 2025 at 19:24):

alexcrichton requested wasmtime-core-reviewers for a review on PR #10872.

view this post on Zulip Wasmtime GitHub notifications bot (May 30 2025 at 19:24):

alexcrichton requested dicej for a review on PR #10872.

view this post on Zulip Wasmtime GitHub notifications bot (May 30 2025 at 19:24):

alexcrichton commented on PR #10872:

I'll note that this is the first in a series of commits, previewed at https://github.com/bytecodealliance/wasmtime/pull/10870

view this post on Zulip Wasmtime GitHub notifications bot (May 30 2025 at 19:43):

fitzgen submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (May 30 2025 at 19:43):

fitzgen created PR review comment:

Maybe (debug) assert that idx != usize::MAX in the constructor now?

view this post on Zulip Wasmtime GitHub notifications bot (May 30 2025 at 20:18):

alexcrichton updated PR #10872.

view this post on Zulip Wasmtime GitHub notifications bot (May 30 2025 at 20:18):

alexcrichton has enabled auto merge for PR #10872.

view this post on Zulip Wasmtime GitHub notifications bot (May 30 2025 at 21:51):

alexcrichton merged PR #10872.


Last updated: Dec 06 2025 at 06:05 UTC