alexcrichton opened PR #10495 from alexcrichton:dont-allocate-empty-bitset
to bytecodealliance:main
:
This commit fixes an issue where
CompoundBitSet::with_capacity(0)
would end up allocation space on the heap due to an off-by-one in the implementation. When calculating the maximum bit that might be set the implementation now subtracts one. This more accurately models the maximum bit that could be set and additionally guarantees the property thatwith_capacity(0)
does not allocate anything on the heap.<!--
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 has marked PR #10495 as ready for review.
alexcrichton requested cfallin for a review on PR #10495.
alexcrichton requested wasmtime-compiler-reviewers for a review on PR #10495.
fitzgen submitted PR review.
alexcrichton merged PR #10495.
Last updated: Apr 18 2025 at 18:04 UTC