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 simplifyingStored<T>and how it works in Wasmtime to avoid requiring allocations (aka pushing onto aStoreDatavector) 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: InstanceIdto thevm::Instancestructure. 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:
If this work has been discussed elsewhere, please include a link to that
conversation. If it was discussed in an issue, just mention "issue #...".Explain why this change is needed. If the details are in an issue already,
this can be brief.Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.htmlPlease ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->
alexcrichton requested wasmtime-core-reviewers for a review on PR #10872.
alexcrichton requested dicej for a review on PR #10872.
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
fitzgen submitted PR review.
fitzgen created PR review comment:
Maybe (debug) assert that
idx != usize::MAXin the constructor now?
alexcrichton updated PR #10872.
alexcrichton has enabled auto merge for PR #10872.
alexcrichton merged PR #10872.
Last updated: Dec 06 2025 at 06:05 UTC