alexcrichton opened PR #9574 from alexcrichton:remove-memory-style-from-mmap-memory
to bytecodealliance:main
:
This commit removes the use fo
MemoryStyle
for determining the size of the allocation of aMmapMemory
. This should semanatically be the same as before but it's hoped that the new version is clearer to understand as it doesn't require going through theMemoryStyle
abstraction to understand how tunables interact with linear memory. The semantics for the allocation of linear memory are:reservation = tunables.memory_reservation growth = tunables.memory_reservation_for_growth if maximum <= reservation { growth = 0 } else if minimum <= reservation { // use settings above } else { reservation = minimum + growth }
This means that the initial memory allocation is always
tunables.memory_reservation
unless that's not large enough to fit the linear memory. In such a situation the other settings, such asmemory_reservation_for_growth
, kick in.The logic of clamping the maximum and/or dealing with static/dynamic are now all unnecessary and/or tracked elsewhere. For example the clamping nature of
maximum
now happens implicitly by rejecting growth whenmemory_may_move
is false which should help keep that complexity localized where necessary rather than conflating multiple settings together.<!--
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 pchickey for a review on PR #9574.
alexcrichton requested wasmtime-core-reviewers for a review on PR #9574.
alexcrichton requested fitzgen for a review on PR #9574.
fitzgen submitted PR review:
:+1:
fitzgen merged PR #9574.
Last updated: Nov 22 2024 at 16:03 UTC