test(allocator): improve unit tests for Arena::try_alloc_layout_fast#23256
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
There was a problem hiding this comment.
Pull request overview
Improves the oxc_allocator unit tests for Arena::try_alloc_layout_fast by strengthening test-case invariants and updating fake-pointer construction to be compatible with Miri’s strict provenance mode.
Changes:
- Add additional assertions in
TestArena::newto validate test inputs (e.g., non-zero start and cursor alignment toMIN_ALIGN). - Replace integer-to-pointer casts with
std::ptr::without_provenance_mutto satisfy strict provenance requirements.
Merging this PR will not alter performance
Comparing Footnotes
|
Merge activity
|
#23256) Improve the unit tests for `Arena::try_alloc_layout_fast` (which purely does maths, no actual allocations). 1. Add more assertions that ensure test cases are correct. 2. Remove integer to pointer casts which Miri rejects under strict provenance rules. The latter enables running Miri with strict provenance enabled (#23258).
db17dc0 to
d32b622
Compare
#23256) Improve the unit tests for `Arena::try_alloc_layout_fast` (which purely does maths, no actual allocations). 1. Add more assertions that ensure test cases are correct. 2. Remove integer to pointer casts which Miri rejects under strict provenance rules. The latter enables running Miri with strict provenance enabled (#23258).

Improve the unit tests for
Arena::try_alloc_layout_fast(which purely does maths, no actual allocations).The latter enables running Miri with strict provenance enabled (#23258).