Stream: git-wasmtime

Topic: wasmtime / PR #5428 wiggle: choose between `&mut self` an...


view this post on Zulip Wasmtime GitHub notifications bot (Dec 13 2022 at 20:01):

abrown opened PR #5428 from wiggle-mutability to main:

Previously, all Wiggle-generated traits were generated with &mut self signatures. With the addition of the mutable configuration option to from_witx! and wasmtime_integration!, one can disable this, emitting instead traits that use &self (i.e., mutable: false). This change is helpful for implementing wasi-threads: WASI implementations with interior mutability will now be able to communitcate this to their Wiggle-generated code.

The other side of this change is the get_cx closure passed to Wiggle's generated add_to_linker function. When mutability is set to true (default), the get_cx function takes a &mut data structure from the store and returns a corresponding &mut reference, usually to a field of the passed-in structure. When mutability: false, the get_cx closure will still take a &mut data structure but now will return a & reference.

<!--

Please ensure that the following steps are all taken care of before submitting
the PR.

Please ensure all communication adheres to the code of conduct.
-->

view this post on Zulip Wasmtime GitHub notifications bot (Dec 13 2022 at 20:01):

abrown has marked PR #5428 as ready for review.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 13 2022 at 20:01):

abrown requested alexcrichton for a review on PR #5428.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 13 2022 at 20:04):

alexcrichton submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 13 2022 at 21:02):

abrown updated PR #5428 from wiggle-mutability to main.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 13 2022 at 22:38):

abrown merged PR #5428.


Last updated: Oct 23 2024 at 20:03 UTC