Skip to content

refactor(allocator): make Arena::is_last_allocation a safe method#21729

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

refactor(allocator): make Arena::is_last_allocation a safe method#21729
graphite-app[bot] merged 1 commit into
mainfrom
om/04-24-refactor_allocator_make_arena_is_last_allocation_a_safe_method

Conversation

@overlookmotel

@overlookmotel overlookmotel commented Apr 24, 2026

Copy link
Copy Markdown
Member

This method has no safety requirements, so it doesn't need to be an unsafe function.

overlookmotel commented Apr 24, 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 24, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 48 untouched benchmarks
⏩ 3 skipped benchmarks1


Comparing om/04-24-refactor_allocator_make_arena_is_last_allocation_a_safe_method (a2104e5) with main (83b91f5)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 (a2104e5) during the generation of this report, so 83b91f5 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 24, 2026
@overlookmotel
overlookmotel marked this pull request as ready for review April 24, 2026 19:39
Copilot AI review requested due to automatic review settings April 24, 2026 19:39
@overlookmotel overlookmotel added C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior A-allocator Area - Allocator labels Apr 24, 2026

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

This PR refactors the allocator arena internals by making Arena::is_last_allocation a safe helper, reflecting that it performs a pure pointer equality check without requiring any safety preconditions.

Changes:

  • Remove unsafe from Arena::is_last_allocation and add a brief doc comment describing its behavior.
  • Update internal call sites to invoke is_last_allocation without unsafe { ... }.

@graphite-app

graphite-app Bot commented Apr 24, 2026

Copy link
Copy Markdown
Contributor

Merge activity

…21729)

This method has no safety requirements, so it doesn't need to be an unsafe function.
@graphite-app
graphite-app Bot force-pushed the om/04-24-refactor_allocator_remove_pointless_debug_assert_s branch from 4aac05b to a717a55 Compare April 24, 2026 21:15
@graphite-app
graphite-app Bot force-pushed the om/04-24-refactor_allocator_make_arena_is_last_allocation_a_safe_method branch from 9ea06ef to a2104e5 Compare April 24, 2026 21:16
Base automatically changed from om/04-24-refactor_allocator_remove_pointless_debug_assert_s to main April 24, 2026 21:20
@graphite-app
graphite-app Bot merged commit a2104e5 into main Apr 24, 2026
37 checks passed
@graphite-app
graphite-app Bot deleted the om/04-24-refactor_allocator_make_arena_is_last_allocation_a_safe_method branch April 24, 2026 21:21
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