Skip to content

refactor(allocator): route all Bump creation through Bump::new_impl function#21341

Merged
graphite-app[bot] merged 1 commit intomainfrom
om/04-12-refactor_allocator_route_all_bump_creation_through_bump_new_impl_function
Apr 12, 2026
Merged

refactor(allocator): route all Bump creation through Bump::new_impl function#21341
graphite-app[bot] merged 1 commit intomainfrom
om/04-12-refactor_allocator_route_all_bump_creation_through_bump_new_impl_function

Conversation

@overlookmotel
Copy link
Copy Markdown
Member

@overlookmotel overlookmotel commented Apr 12, 2026

Pure refactor. Add a helper function Bump::new_implwhich creates a Bump. Use that helper instead of constructing Bumps directly in various places. This has little benefit in itself, but reduces the amount of repeated code required to move allocation tracking into Bump (next PR #21342).

Copy link
Copy Markdown
Member Author

overlookmotel commented Apr 12, 2026


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.

@github-actions github-actions Bot added A-allocator Area - Allocator C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior labels Apr 12, 2026
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Apr 12, 2026

Merging this PR will not alter performance

✅ 48 untouched benchmarks
⏩ 3 skipped benchmarks1


Comparing om/04-12-refactor_allocator_route_all_bump_creation_through_bump_new_impl_function (9129a0a) with om/04-12-fix_allocator_stringbuilder_use_allocator_alloc_layout_ (36f505f)

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.

@overlookmotel overlookmotel self-assigned this Apr 12, 2026
@overlookmotel overlookmotel marked this pull request as ready for review April 12, 2026 14:38
Copilot AI review requested due to automatic review settings April 12, 2026 14:38
Copy link
Copy Markdown
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

Refactors oxc_allocator::bump::Bump construction to go through a single internal helper (Bump::new_impl), reducing duplicated initialization logic and preparing for follow-up work to centralize allocation tracking inside Bump (per #21342).

Changes:

  • Introduced Bump::new_impl(chunk_footer_ptr, allocation_limit) as the centralized initializer.
  • Updated with_min_align, try_with_min_align_and_capacity (capacity==0 and normal path), and from_raw_parts to use new_impl instead of struct literals.

@graphite-app
Copy link
Copy Markdown
Contributor

graphite-app Bot commented Apr 12, 2026

Merge activity

…l` function (#21341)

Pure refactor. Add a helper function `Bump::new_impl`which creates a `Bump`. Use that helper instead of constructing `Bump`s directly in various places. This has little benefit in itself, but reduces the amount of repeated code required to move allocation tracking into `Bump` (next PR #21342).
@graphite-app graphite-app Bot force-pushed the om/04-12-fix_allocator_stringbuilder_use_allocator_alloc_layout_ branch from c3603c0 to 36f505f Compare April 12, 2026 15:07
@graphite-app graphite-app Bot requested review from Dunqing and leaysgur as code owners April 12, 2026 15:07
@graphite-app graphite-app Bot force-pushed the om/04-12-refactor_allocator_route_all_bump_creation_through_bump_new_impl_function branch from ecc4100 to 9129a0a Compare April 12, 2026 15:07
Base automatically changed from om/04-12-fix_allocator_stringbuilder_use_allocator_alloc_layout_ to main April 12, 2026 15:18
@graphite-app graphite-app Bot merged commit 9129a0a into main Apr 12, 2026
37 checks passed
@graphite-app graphite-app Bot deleted the om/04-12-refactor_allocator_route_all_bump_creation_through_bump_new_impl_function branch April 12, 2026 15:19
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