refactor(allocator)!: put AllocatorPool behind pool feature#13373
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via 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. |
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the AllocatorPool to be conditionally compiled behind a pool feature, optimizing dependencies for components that don't need pooled allocation functionality. The change reduces bloat for parser, transformer, minifier and other components while allowing the linter to explicitly opt into pool functionality.
- Adds a new
poolcargo feature tooxc_allocator - Updates conditional compilation attributes to gate
AllocatorPoolbehind thepoolfeature - Enables the
poolfeature inoxc_linterwhich requiresAllocatorPool
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| crates/oxc_linter/Cargo.toml | Explicitly enables the pool feature for the allocator dependency |
| crates/oxc_allocator/src/lib.rs | Updates #[cfg] attributes to conditionally compile pool-related code behind the pool feature |
| crates/oxc_allocator/README.md | Documents the new pool feature |
| crates/oxc_allocator/Cargo.toml | Defines the new pool feature and makes fixed_size depend on it |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
CodSpeed Instrumentation Performance ReportMerging #13373 will not alter performanceComparing Summary
Footnotes |
Merge activity
|
`AllocatorPool` is only used in linter. Parser, transformer, minifier etc don't need it. So put it behind a `pool` cargo feature. This complicates the many `#[cfg]` attrs even further, but this is preparation for merging the 2 `AllocatorPool` implementations, and removing the `fixed_size` feature, which will remove a lot of this `#[cfg]` mess.
217ff10 to
df8e639
Compare

AllocatorPoolis only used in linter. Parser, transformer, minifier etc don't need it. So put it behind apoolcargo feature.This complicates the many
#[cfg]attrs even further, but this is preparation for merging the 2AllocatorPoolimplementations, and removing thefixed_sizefeature, which will remove a lot of this#[cfg]mess.