Stream: git-wasmtime

Topic: wasmtime / PR #11211 Make `vm::Instance::get_defined_memo...


view this post on Zulip Wasmtime GitHub notifications bot (Jul 10 2025 at 02:27):

alexcrichton opened PR #11211 from alexcrichton:defined-index-in-libcalls to bytecodealliance:main:

This is a small step forward to making vm::Instance safe internally. Notably the get_defined_memory helper 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 unsafe VMContext to Instance conversion 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_init libcall just yet due to the fact that the DataIndex is 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 the unsafe related to memory/table management in vm::Instance.

<!--
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 (Jul 10 2025 at 02:27):

alexcrichton requested abrown for a review on PR #11211.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 10 2025 at 02:27):

alexcrichton requested wasmtime-compiler-reviewers for a review on PR #11211.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 10 2025 at 02:27):

alexcrichton requested fitzgen for a review on PR #11211.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 10 2025 at 02:27):

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

view this post on Zulip Wasmtime GitHub notifications bot (Jul 10 2025 at 03:59):

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:

To subscribe or unsubscribe from this label, edit the <code>.github/subscribe-to-label.json</code> configuration file.

Learn more.
</details>

view this post on Zulip Wasmtime GitHub notifications bot (Jul 10 2025 at 16:18):

fitzgen submitted PR review:

Very nice!

view this post on Zulip Wasmtime GitHub notifications bot (Jul 10 2025 at 16:43):

fitzgen merged PR #11211.


Last updated: Dec 06 2025 at 07:03 UTC