alexcrichton opened PR #4209 from fix-vmcontext-size-with-improts
to main
:
This fixes an oversight in the initial creation of
VMOffsets
for a
module to avoid double-counting imported globals, tables, and memories
for calculating the size of theVMContext
. Prior to this PR imported
items are accidentally also counted as defined items for sizing
calculations meaning that when a memory is imported but not defined, for
example, theVMContext
will have a space for an inline
VMMemoryDefinition
when it doesn't need to.Auditing where all this relates to it appears that the only issue from
this mistake is thatVMContext
is a bit larger than it would otherwise
need to be. Extra slots are uninitialized memory but nothing in Wasmtime
ever actually accesses the memory either, so it should be harmless to
have extra space here. Nevertheless it seems better to shrink the size
as much as possible to avoid wasting space where we can.<!--
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.
-->
alexcrichton updated PR #4209 from fix-vmcontext-size-with-improts
to main
.
cfallin submitted PR review.
alexcrichton updated PR #4209 from fix-vmcontext-size-with-improts
to main
.
alexcrichton merged PR #4209.
Last updated: Nov 22 2024 at 16:03 UTC