Skip to content

Define VMContext and VMComponentContext in a macro - #14083

Open
fitzgen wants to merge 1 commit into
bytecodealliance:mainfrom
fitzgen:vmctx-types-into-macro
Open

Define VMContext and VMComponentContext in a macro#14083
fitzgen wants to merge 1 commit into
bytecodealliance:mainfrom
fitzgen:vmctx-types-into-macro

Conversation

@fitzgen

@fitzgen fitzgen commented Aug 5, 2026

Copy link
Copy Markdown
Member

And automatically generate their offsets, alias region load/store helpers, etc... from the single macro definition. Similar to the existing macro for other VM* types, but these definitions are parameterized over a specific Wasm module or component and the entities defined therein.

And automatically generate their offsets, alias region load/store helpers,
etc... from the single macro definition. Similar to the existing macro for other
`VM*` types, but these definitions are parameterized over a specific Wasm module
or component and the entities defined therein.
@fitzgen
fitzgen requested review from a team as code owners August 5, 2026 20:28
@fitzgen
fitzgen requested review from alexcrichton and removed request for a team August 5, 2026 20:28
@github-actions github-actions Bot added wasmtime:api Related to the API of the `wasmtime` crate itself winch Winch issues or pull requests labels Aug 5, 2026
@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown

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 .github/subscribe-to-label.json configuration file.

Learn more.

/// Return a pointer to the collector-specific heap data.
pub fn gc_heap_data(self: Pin<&mut Self>) -> &mut Option<VmPtr<u8>> {
let offset = self.offsets().ptr.vmctx_gc_heap_data();
let offset = self.offsets().ptr.vmctx().gc_heap_data();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since accesses like this (throughout the runtime) can be perf-sensitive, have you double-checked that methods are inlined and/or #[inline]'d as needed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

wasmtime:api Related to the API of the `wasmtime` crate itself winch Winch issues or pull requests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants