fitzgen opened PR #10349 from fitzgen:free-list-and-v128
to bytecodealliance:main
:
Additionally, support alignment 16 for
v128
s inside GC objects.We previously allowed the alignment and minimum block size to be different values, and did not round allocation sizes up to the minimum block size. This could lead to bugs like the following sequence of events:
- free list initially has a block 0x10..MAX
- alloc(size=16) -> 0x10
- free list now has one block: 0x20..MAX
- alloc(size=16) -> 0x20
- free list now has one block: 0x30..MAX
- dealloc(0x10, size=16)
- this merges 0x10..0x20 into 0x30..MAX because the gap between 0x20 and 0x30 is smaller than the minimum block size
- dealloc(0x20, size=16)
- triggers overlapping blocks assertion failure!
If we ensure that the minimum allocation size is a multiple of our supported alignment and we clamp requested allocations' sizes to at least the minimum block size, then we could avoid this.
It is simpler, however, to unify our supported alignment and our minimum block size into the same value. This PR does that. No more need for multiple concepts which interact in subtle ways.
<!--
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
-->
fitzgen requested wasmtime-core-reviewers for a review on PR #10349.
fitzgen requested dicej for a review on PR #10349.
github-actions[bot] commented on PR #10349:
Subscribe to Label Action
cc @fitzgen
<details>
This issue or pull request has been labeled: "wasmtime:api", "wasmtime:ref-types"Thus the following users have been cc'd because of the following labels:
- fitzgen: wasmtime:ref-types
To subscribe or unsubscribe from this label, edit the <code>.github/subscribe-to-label.json</code> configuration file.
Learn more.
</details>
alexcrichton submitted PR review.
alexcrichton merged PR #10349.
Last updated: Apr 17 2025 at 20:03 UTC