Skip to content

refactor(allocator): simplify is_pointer_aligned_to#21741

Merged
graphite-app[bot] merged 1 commit into
mainfrom
om/04-25-refactor_allocator_simplify_is_pointer_aligned_to_
Apr 25, 2026
Merged

refactor(allocator): simplify is_pointer_aligned_to#21741
graphite-app[bot] merged 1 commit into
mainfrom
om/04-25-refactor_allocator_simplify_is_pointer_aligned_to_

Conversation

@overlookmotel

@overlookmotel overlookmotel commented Apr 25, 2026

Copy link
Copy Markdown
Member

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

overlookmotel commented Apr 25, 2026

Copy link
Copy Markdown
Member Author

How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent changes, fast-track this PR to the front of 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.

@codspeed-hq

codspeed-hq Bot commented Apr 25, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 48 untouched benchmarks
⏩ 3 skipped benchmarks1


Comparing om/04-25-refactor_allocator_simplify_is_pointer_aligned_to_ (7fa4826) with main (1b97124)2

Open in CodSpeed

Footnotes

  1. 3 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

  2. No successful run was found on main (2e2bb90) during the generation of this report, so 1b97124 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@overlookmotel overlookmotel self-assigned this Apr 25, 2026
@overlookmotel overlookmotel added A-allocator Area - Allocator C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior labels Apr 25, 2026
@overlookmotel
overlookmotel force-pushed the om/04-25-refactor_allocator_simplify_is_pointer_aligned_to_ branch from 332198f to 8a21fa6 Compare April 25, 2026 10:06
@overlookmotel
overlookmotel marked this pull request as ready for review April 25, 2026 10:42
Copilot AI review requested due to automatic review settings April 25, 2026 10:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)]

Comment thread crates/oxc_allocator/src/arena/utils.rs
@graphite-app

graphite-app Bot commented Apr 25, 2026

Copy link
Copy Markdown
Contributor

Merge activity

Simplify the implementation of `is_pointer_aligned_to`. Results in the same assembly, but is clearer exactly what it does.
@graphite-app
graphite-app Bot force-pushed the om/04-25-refactor_allocator_is_pointer_aligned_to_take_any_pointer branch from faed9a1 to 2e2bb90 Compare April 25, 2026 11:24
@graphite-app
graphite-app Bot force-pushed the om/04-25-refactor_allocator_simplify_is_pointer_aligned_to_ branch from 8a21fa6 to 7fa4826 Compare April 25, 2026 11:25
Base automatically changed from om/04-25-refactor_allocator_is_pointer_aligned_to_take_any_pointer to main April 25, 2026 11:30
@graphite-app
graphite-app Bot merged commit 7fa4826 into main Apr 25, 2026
38 checks passed
@graphite-app
graphite-app Bot deleted the om/04-25-refactor_allocator_simplify_is_pointer_aligned_to_ branch April 25, 2026 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-allocator Area - Allocator C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants