Skip to content

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Dec 18, 2025

Follow-on after #17023. Pure refactor.

Move code out of FixedSizeAllocatorPool::get, to make it easier to read. Also add comments.

Copy link
Member Author

overlookmotel commented Dec 18, 2025


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 hot fixes, skip the queue and merge this PR next

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.

Copy link
Contributor

@camc314 camc314 left a comment

Choose a reason for hiding this comment

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

lol, claude suggested this change while I was working on it, and I deliberately didn't do it because it felt like I was mixing the two concerns of the pool and the fixed size allocator.

Iirc, it's also unsafe to call this function on a fixed size allocator if you didn't get it out of the pool?

Copy link
Contributor

Copilot AI left a comment

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 FixedSizeAllocatorPool::get method by extracting a nested function into a proper method on FixedSizeAllocator. The change improves code readability without altering any logic.

  • Moved nested into_allocator function to FixedSizeAllocator::into_inner method
  • Added explanatory comments to the get method flow
  • Added #[inline] attribute to optimize the no-op method

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codspeed-hq
Copy link

codspeed-hq bot commented Dec 18, 2025

CodSpeed Performance Report

Merging #17078 will not alter performance

Comparing om/12-18-refactor_allocator_move_nested_function_out_of_fixedsizeallocatorpool_get_ (348c622) with om/12-18-refactor_allocator_remove_allocerror_from_fixed_size_allocator (024ab0a)1

Summary

✅ 42 untouched
⏩ 3 skipped2

Footnotes

  1. No successful run was found on om/12-18-refactor_allocator_remove_allocerror_from_fixed_size_allocator (e8c0e07) during the generation of this report, so 1182150 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

  2. 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.

@overlookmotel
Copy link
Member Author

lol, claude suggested this change while I was working on it, and I deliberately didn't do it because it felt like I was mixing the two concerns of the pool and the fixed size allocator.

This whole thing with fixed size allocators is held together with gaffer tape and string. It's a disaster area, and UB is only a slip of the keyboard away. Everything is entwined with each-other, and it's gratuitously unsound. So I don't think separation of concerns really applies - and that's the problem - there isn't any!

Iirc, it's also unsafe to call this function on a fixed size allocator if you didn't get it out of the pool?

Correct. But there's nowhere else to get one.

@overlookmotel overlookmotel force-pushed the om/12-18-refactor_allocator_remove_allocerror_from_fixed_size_allocator branch from 024ab0a to e8c0e07 Compare December 18, 2025 23:02
@overlookmotel overlookmotel force-pushed the om/12-18-refactor_allocator_move_nested_function_out_of_fixedsizeallocatorpool_get_ branch from 1f5a828 to 348c622 Compare December 18, 2025 23:02
@overlookmotel overlookmotel self-assigned this Dec 18, 2025
@overlookmotel overlookmotel added the A-linter-plugins Area - Linter JS plugins label Dec 18, 2025
@graphite-app graphite-app bot added the 0-merge Merge with Graphite Merge Queue label Dec 18, 2025
@graphite-app
Copy link
Contributor

graphite-app bot commented Dec 18, 2025

Merge activity

…ool::get` (#17078)

Follow-on after #17023. Pure refactor.

Move code out of `FixedSizeAllocatorPool::get`, to make it easier to read. Also add comments.
@graphite-app graphite-app bot force-pushed the om/12-18-refactor_allocator_remove_allocerror_from_fixed_size_allocator branch from e8c0e07 to d37d728 Compare December 18, 2025 23:43
@graphite-app graphite-app bot force-pushed the om/12-18-refactor_allocator_move_nested_function_out_of_fixedsizeallocatorpool_get_ branch from 348c622 to 40a30fe Compare December 18, 2025 23:44
Base automatically changed from om/12-18-refactor_allocator_remove_allocerror_from_fixed_size_allocator to main December 18, 2025 23:49
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Dec 18, 2025
@graphite-app graphite-app bot merged commit 40a30fe into main Dec 18, 2025
22 checks passed
@graphite-app graphite-app bot deleted the om/12-18-refactor_allocator_move_nested_function_out_of_fixedsizeallocatorpool_get_ branch December 18, 2025 23:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-linter-plugins Area - Linter JS plugins 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.

3 participants