pchickey opened PR #2202 from pch/wasi_common_move_entry_methods
to main
:
based on #2201
<!--
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.
-->
pchickey updated PR #2202 from pch/wasi_common_move_entry_methods
to main
:
based on #2201
<!--
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.
-->
pchickey updated PR #2202 from pch/wasi_common_move_entry_methods
to main
:
based on #2201
<!--
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.
-->
pchickey updated PR #2202 from pch/wasi_common_move_entry_methods
to main
:
based on #2201
<!--
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.
-->
pchickey edited PR #2202 from pch/wasi_common_move_entry_methods
to main
:
based on #2201
This PR refactors the bodies of all
fs
andpath
functions in snapshot 1 intoEntry
methods.Anything that just requires an entry be in scope is moved to
entry/fd.rs
andentry/path.rs
, which just containimpl Entry
blocks.Additionally, the bodies of these functions were transformed so that as
much GuestPtr dereference as possible happens out in
wasi_snapshot_preview1. Entry methods just get a& T
or&mut T
passed in.However, there are a few functions where multiple GuestPtrs are passed
into a wasi_snapshot_preview1 function. We cannot safely dereference
both at once, because it is semantically valid for these memory
regions to overlap, but the wiggle borrow checker will refuse to
borrow overlapping regions. In these cases, we have to pass the GuestPtr
into the Entity method to be dereferenced in a smaller scope where
exclusive access is possible.Additionally, we make the minor transformation so that
crate::path::get
becomes
Entry::path_get
. This moves from src/path.rs to src/entry/path.rs. This is just code
motion and doesn't make a difference.<!--
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.
-->
pchickey updated PR #2202 from pch/wasi_common_move_entry_methods
to main
:
based on #2201
This PR refactors the bodies of all
fs
andpath
functions in snapshot 1 intoEntry
methods.Anything that just requires an entry be in scope is moved to
entry/fd.rs
andentry/path.rs
, which just containimpl Entry
blocks.Additionally, the bodies of these functions were transformed so that as
much GuestPtr dereference as possible happens out in
wasi_snapshot_preview1. Entry methods just get a& T
or&mut T
passed in.However, there are a few functions where multiple GuestPtrs are passed
into a wasi_snapshot_preview1 function. We cannot safely dereference
both at once, because it is semantically valid for these memory
regions to overlap, but the wiggle borrow checker will refuse to
borrow overlapping regions. In these cases, we have to pass the GuestPtr
into the Entity method to be dereferenced in a smaller scope where
exclusive access is possible.Additionally, we make the minor transformation so that
crate::path::get
becomes
Entry::path_get
. This moves from src/path.rs to src/entry/path.rs. This is just code
motion and doesn't make a difference.<!--
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.
-->
pchickey updated PR #2202 from pch/wasi_common_move_entry_methods
to main
:
based on #2201
This PR refactors the bodies of all
fs
andpath
functions in snapshot 1 intoEntry
methods.Anything that just requires an entry be in scope is moved to
entry/fd.rs
andentry/path.rs
, which just containimpl Entry
blocks.Additionally, the bodies of these functions were transformed so that as
much GuestPtr dereference as possible happens out in
wasi_snapshot_preview1. Entry methods just get a& T
or&mut T
passed in.However, there are a few functions where multiple GuestPtrs are passed
into a wasi_snapshot_preview1 function. We cannot safely dereference
both at once, because it is semantically valid for these memory
regions to overlap, but the wiggle borrow checker will refuse to
borrow overlapping regions. In these cases, we have to pass the GuestPtr
into the Entity method to be dereferenced in a smaller scope where
exclusive access is possible.Additionally, we make the minor transformation so that
crate::path::get
becomes
Entry::path_get
. This moves from src/path.rs to src/entry/path.rs. This is just code
motion and doesn't make a difference.<!--
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.
-->
pchickey requested iximeow for a review on PR #2202.
sunfishcode submitted PR Review.
pchickey updated PR #2202 from pch/wasi_common_move_entry_methods
to main
:
based on #2201
This PR refactors the bodies of all
fs
andpath
functions in snapshot 1 intoEntry
methods.Anything that just requires an entry be in scope is moved to
entry/fd.rs
andentry/path.rs
, which just containimpl Entry
blocks.Additionally, the bodies of these functions were transformed so that as
much GuestPtr dereference as possible happens out in
wasi_snapshot_preview1. Entry methods just get a& T
or&mut T
passed in.However, there are a few functions where multiple GuestPtrs are passed
into a wasi_snapshot_preview1 function. We cannot safely dereference
both at once, because it is semantically valid for these memory
regions to overlap, but the wiggle borrow checker will refuse to
borrow overlapping regions. In these cases, we have to pass the GuestPtr
into the Entity method to be dereferenced in a smaller scope where
exclusive access is possible.Additionally, we make the minor transformation so that
crate::path::get
becomes
Entry::path_get
. This moves from src/path.rs to src/entry/path.rs. This is just code
motion and doesn't make a difference.<!--
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.
-->
pchickey closed without merge PR #2202.
Last updated: Nov 22 2024 at 16:03 UTC