alexcrichton opened PR #8608 from alexcrichton:start-using-bytes-not-pages
to bytecodealliance:main
:
This commit is inspired by me looking at some configuration in the pooling allocator and noticing that configuration of wasm pages vs bytes of linear memory is somewhat inconsistent in
Config
. In the end I'd like to remove or update thememory_pages
configuration in the pooling allocator to being bytes of linear memory instead to be more consistent withConfig
(and additionally anticipate the custom-page-sizes wasm proposal where terms-of-pages will become ambiguous). The first step in this change is to update one of the lowest layered usages of pages, theMemoryStyle::Static
configuration.Note that this is not a trivial conversion because the purpose of carrying around pages instead of bytes is that bytes may overflow where overflow-with-pages typically happens during validation. This means that extra care is taken to handle errors related to overflow to ensure that everything is still reported at the same time.
<!--
Please make sure you include the following information:
If this work has been discussed elsewhere, please include a link to that
conversation. If it was discussed in an issue, just mention "issue #...".Explain why this change is needed. If the details are in an issue already,
this can be brief.Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.htmlPlease ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->
alexcrichton requested cfallin for a review on PR #8608.
alexcrichton requested wasmtime-compiler-reviewers for a review on PR #8608.
alexcrichton requested fitzgen for a review on PR #8608.
alexcrichton requested wasmtime-core-reviewers for a review on PR #8608.
fitzgen submitted PR review:
Nice! Thanks for doing this, it will def make implementing the custom-page-sizes proposal easier once I get around to that
fitzgen submitted PR review:
Nice! Thanks for doing this, it will def make implementing the custom-page-sizes proposal easier once I get around to that
fitzgen created PR review comment:
satisfy static bound of {byte_reservation:#x} bytes"
fitzgen submitted PR review.
fitzgen created PR review comment:
(your lack of rust-analyzer didn't save you this time)
alexcrichton updated PR #8608.
alexcrichton has enabled auto merge for PR #8608.
alexcrichton updated PR #8608.
alexcrichton updated PR #8608.
alexcrichton merged PR #8608.
Last updated: Dec 23 2024 at 12:05 UTC