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 anOption
which isNone
when attempting to view the WebAssembly data as a string and the underlying WebAssembly memory is shared. This reuses theUnsafeGuestSlice
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 toexpect
that a non-shared memory is used. (Note that I can find no uses ofGuestStrMut
in the WASI implementations).<!--
Please ensure that the following steps are all taken care of before submitting
the PR.
[ ] This has been discussed in issue #..., or if not, please tell us why
here.[ ] A short description of what this does, why it is needed; if the
description becomes long, the matter should probably be discussed in an issue
first.[ ] This PR contains test cases, if meaningful.
- [ ] A reviewer from the core maintainer team has been assigned for this PR.
If you don't know who could review this, please indicate so. The list of
suggested reviewers on the right can help you.Please ensure all communication adheres to the code of conduct.
-->
abrown requested alexcrichton for a review on PR #5264.
alexcrichton submitted PR review.
abrown updated PR #5264 from shmem-in-wiggle-str
to main
.
abrown has marked PR #5264 as ready for review.
alexcrichton submitted PR review.
alexcrichton has enabled auto merge for PR #5264.
alexcrichton merged PR #5264.
Last updated: Nov 22 2024 at 16:03 UTC