refactor(allocator): simplify is_pointer_aligned_to#21741
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. |
0930b77 to
faed9a1
Compare
00d3c3e to
332198f
Compare
Merging this PR will not alter performance
Comparing Footnotes
|
332198f to
8a21fa6
Compare
There was a problem hiding this comment.
Pull request overview
Refactors is_pointer_aligned_to to a simpler bitmask-based alignment check and documents the alignment requirement/inlining rationale.
Changes:
- Replace
round_down_to-based comparison with(addr & (align - 1)) == 0 - Add rustdoc explaining alignment requirements and rationale for
#[inline(always)]
Merge activity
|
Simplify the implementation of `is_pointer_aligned_to`. Results in the same assembly, but is clearer exactly what it does.
faed9a1 to
2e2bb90
Compare
8a21fa6 to
7fa4826
Compare

Simplify the implementation of
is_pointer_aligned_to. Results in the same assembly, but is clearer exactly what it does.