Skip to content

refactor(allocator): add Allocator::new_fixed_size method#22084

Merged
graphite-app[bot] merged 1 commit intomainfrom
om/05-02-refactor_allocator_add_allocator_new_fixed_size_method
May 2, 2026
Merged

refactor(allocator): add Allocator::new_fixed_size method#22084
graphite-app[bot] merged 1 commit intomainfrom
om/05-02-refactor_allocator_add_allocator_new_fixed_size_method

Conversation

@overlookmotel
Copy link
Copy Markdown
Member

@overlookmotel overlookmotel commented May 2, 2026

Add a method new_fixed_size to Arena and Allocator. This moves logic for creating fixed-size allocators out of FixedSizeAllocatorPool and into core Arena implementation.

This is starting point for making fixed-size allocators safer, managing their own memory, and having platform-specific behavior for creation and drop (moving towards fixing the Windows OOM bug in Oxlint and napi/parser raw transfer).

Copy link
Copy Markdown
Member Author

overlookmotel commented May 2, 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.

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented May 2, 2026

Merging this PR will not alter performance

✅ 48 untouched benchmarks
⏩ 3 skipped benchmarks1


Comparing om/05-02-refactor_allocator_add_allocator_new_fixed_size_method (6de10fc) with main (d58f594)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 (6de10fc) during the generation of this report, so d58f594 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

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 fixed-size allocator creation by introducing Allocator::new_fixed_size and Arena::new_fixed_size, moving the backing-allocation logic out of FixedSizeAllocatorPool and into the core allocator implementation to support future safety/platform work.

Changes:

  • Add Allocator::new_fixed_size and Arena::new_fixed_size (feature/target gated).
  • Move the fixed-size backing allocation + alignment workaround into crates/oxc_allocator/src/arena/fixed_size.rs.
  • Update FixedSizeAllocatorPool to construct fixed-size allocators via the new API.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
crates/oxc_allocator/src/pool/fixed_size.rs Switch pool allocator creation to Allocator::new_fixed_size and adjust chunk pointer derivation.
crates/oxc_allocator/src/lib.rs Add feature/target-gated fixed_size module.
crates/oxc_allocator/src/fixed_size.rs Introduce Allocator::new_fixed_size API.
crates/oxc_allocator/src/arena/mod.rs Add feature/target-gated arena fixed_size module.
crates/oxc_allocator/src/arena/fixed_size.rs Implement Arena::new_fixed_size and relocate the large-alignment allocation workaround.

Comment thread crates/oxc_allocator/src/fixed_size.rs
Comment thread crates/oxc_allocator/src/pool/fixed_size.rs
@overlookmotel overlookmotel added C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior A-allocator Area - Allocator labels May 2, 2026
@graphite-app
Copy link
Copy Markdown
Contributor

graphite-app Bot commented May 2, 2026

Merge activity

Add a method `new_fixed_size` to `Arena` and `Allocator`. This moves logic for creating fixed-size allocators out of `FixedSizeAllocatorPool` and into core `Arena` implementation.

This is starting point for making fixed-size allocators safer, managing their own memory, and having platform-specific behavior for creation and drop (moving towards fixing the Windows OOM bug in Oxlint and `napi/parser` raw transfer).
@graphite-app graphite-app Bot force-pushed the om/05-02-refactor_allocator_add_allocator_new_fixed_size_method branch from 1638b41 to 6de10fc Compare May 2, 2026 23:05
@graphite-app graphite-app Bot merged commit 6de10fc into main May 2, 2026
36 checks passed
@graphite-app graphite-app Bot deleted the om/05-02-refactor_allocator_add_allocator_new_fixed_size_method branch May 2, 2026 23:08
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