alexcrichton opened PR #11229 from alexcrichton:less-exports to bytecodealliance:main:
This series of commits removes all of the
vm::Export*types from Wasmtime. These were all relatively unsafe types which were schlepping around unsafe pointers from point A to point B. In lieu of this and given prior refactorings this commit replaces all of these items with the top-level crate definitions (e.g.crate::Funcinstead ofExportFunc). The goal here is to improve safety and generally reduceunsafefunctions and blocks necessary. A nice benefit is that from avm::Instanceyou can now directly load all top-level types such ascrate::Table.
alexcrichton requested fitzgen for a review on PR #11229.
alexcrichton requested wasmtime-core-reviewers for a review on PR #11229.
alexcrichton updated PR #11229.
github-actions[bot] commented on PR #11229:
Subscribe to Label Action
cc @fitzgen
<details>
This issue or pull request has been labeled: "wasmtime:api", "wasmtime:ref-types"Thus the following users have been cc'd because of the following labels:
- fitzgen: wasmtime:ref-types
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:
LGTM modulo one safety comment/question below that should be addressed before merging
fitzgen created PR review comment:
yesss
fitzgen created PR review comment:
Can we actually encapsulate the unsafety here? Because
from_vm_func_refrequires that the store owns the given funcref, but because we take the store as an argument but get the funcref fromself, we don't technically have the guarantee that the given store owns this funcref. So I think either this function should beunsafebecause it relies on passing the correctStoreIdin, or we need to get thatStoreIdfromselfsomehow.
fitzgen created PR review comment:
Needs safety comment
alexcrichton updated PR #11229.
alexcrichton submitted PR review.
alexcrichton created PR review comment:
Good point yeah, I meant to come back and fix this up but forgot to do so. It's a bit unfortunate how infectious the unsafety is here but I agree it's required to be sound regardless.
alexcrichton has enabled auto merge for PR #11229.
alexcrichton merged PR #11229.
Last updated: Dec 06 2025 at 06:05 UTC