alexcrichton opened PR #4407 from remove-region
to main
:
This commit removes Wasmtime's dependency on the
region
crate. The
motivation for this came about when I was updating dependencies and saw
thatregion
had a new major version at 3.0.0 as opposed to our
currently used 2.3 track. In reviewing the use cases ofregion
within
Wasmtime I found two trends in particular which motivated this commit:
Some unix-specific areas of
wasmtime_runtime
use
rustix::mm::mprotect
instead ofregion::protect
already. This
means that the usage ofregion::protect
for changing virtual memory
protections was already inconsistent.Many uses of
region::protect
were already in unix-specific regions
which could make use ofrustix
.Overall I opted to remove the dependency on the
region
crate to avoid
chasing its versions over time. Unix-specific changes of protections
were easily changed torustix::mm::mprotect
. There were two locations
where a windows/unix split is now required and I subjectively ruled
"that seems ok". Finally removingregion
also meant that the "what is
the current page size" query needed to be inlined into
wasmtime_runtime
, which I have also subjectively ruled "that seems
fine".Finally one final refactoring here was that the
unix.rs
andlinux.rs
split for the pooling allocator was merged. These two files already only
differed in one function so I slapped acfg_if!
in there to help
reduce the duplication.<!--
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.
-->
fitzgen submitted PR review.
alexcrichton has enabled auto merge for PR #4407.
sunfishcode submitted PR review.
sunfishcode submitted PR review.
sunfishcode created PR review comment:
These extra
rustix::mm::*
qualifiers are redundant becauseProtFlags
andMapFlags
are already in scope.
alexcrichton updated PR #4407 from remove-region
to main
.
alexcrichton updated PR #4407 from remove-region
to main
.
alexcrichton merged PR #4407.
Last updated: Dec 23 2024 at 12:05 UTC