Stream: git-wasmtime

Topic: wasmtime / PR #5264 wiggle: adapt Wiggle strings for shar...


view this post on Zulip Wasmtime GitHub notifications bot (Nov 14 2022 at 18:58):

abrown opened PR #5264 from shmem-in-wiggle-str to main:

This is an extension of #5229 for the &str and &mut str types. As documented there, we are attempting to maintain Rust guarantees for slices that Wiggle hands out in the presence of WebAssembly shared memory, in which case multiple threads could be modifying the underlying data of the slice.

This change changes the API of GuestPtr to return an Option which is None when attempting to view the WebAssembly data as a string and the underlying WebAssembly memory is shared. This reuses the UnsafeGuestSlice structure from #5229 to do so and appropriately marks the region as borrowed in Wiggle's manual borrow checker. Each original call site in this project's WASI implementations is fixed up to expect that a non-shared memory is used. (Note that I can find no uses of GuestStrMut in the WASI implementations).

<!--

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 (Nov 14 2022 at 18:58):

abrown requested alexcrichton for a review on PR #5264.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 14 2022 at 19:46):

alexcrichton submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 14 2022 at 21:42):

abrown updated PR #5264 from shmem-in-wiggle-str to main.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 14 2022 at 21:43):

abrown has marked PR #5264 as ready for review.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 14 2022 at 22:21):

alexcrichton submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 14 2022 at 22:21):

alexcrichton has enabled auto merge for PR #5264.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 14 2022 at 22:33):

alexcrichton merged PR #5264.


Last updated: Nov 22 2024 at 16:03 UTC