alexcrichton opened PR #11211 from alexcrichton:defined-index-in-libcalls to bytecodealliance:main:
This is a small step forward to making
vm::Instancesafe internally. Notably theget_defined_memoryhelper now returns a safe mutable reference instead of a raw pointer. This is then additionally coupled with the canonicalization of always working with memories as "instance plus defined memory index" instead of "instance plus memory index". This enables removing some unsafeVMContexttoInstanceconversion as well. This change, however, required updating libcalls to special-case when an imported memory is operated on to load the vmcontext/index in the libcall itself.This change notably does not update the
memory_initlibcall just yet due to the fact that theDataIndexis relative to the owning instance even if the memory is owned by a different instance (e.g. it's imported). Otherwise this chips away at some of theunsaferelated to memory/table management invm::Instance.<!--
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 abrown for a review on PR #11211.
alexcrichton requested wasmtime-compiler-reviewers for a review on PR #11211.
alexcrichton requested fitzgen for a review on PR #11211.
alexcrichton requested wasmtime-core-reviewers for a review on PR #11211.
github-actions[bot] commented on PR #11211:
Subscribe to Label Action
cc @saulecabrera
<details>
This issue or pull request has been labeled: "wasmtime:api", "winch"Thus the following users have been cc'd because of the following labels:
- saulecabrera: winch
To subscribe or unsubscribe from this label, edit the <code>.github/subscribe-to-label.json</code> configuration file.
Learn more.
</details>
fitzgen submitted PR review:
Very nice!
fitzgen merged PR #11211.
Last updated: Dec 06 2025 at 07:03 UTC