refactor(linter/plugins, napi/plugins): use constant for arena alignment from Allocator#21797
Merged
graphite-app[bot] merged 1 commit intomainfrom Apr 26, 2026
Conversation
This was referenced Apr 26, 2026
Merged
Member
Author
Contributor
There was a problem hiding this comment.
Pull request overview
Refactors the raw-transfer parsing paths in oxlint and the N-API parser to stop hard-coding arena/chunk alignment and instead derive it from Allocator, reducing the risk of alignment drift if allocator internals change.
Changes:
- Replaces hard-coded
16alignment constants withAllocator::RAW_MIN_ALIGN. - Renames
BUMP_ALIGNtoARENA_ALIGNto match theArenanaming. - Updates alignment-based offset calculations/asserts to use the new constant.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
napi/parser/src/raw_transfer.rs |
Uses Allocator::RAW_MIN_ALIGN for raw-transfer allocator alignment and updates related asserts/offset rounding. |
apps/oxlint/src/js_plugins/parse.rs |
Uses Allocator::RAW_MIN_ALIGN for raw-transfer parsing alignment and updates the cursor alignment logic accordingly. |
75ba45c to
d1e4c50
Compare
87e8340 to
8fb23df
Compare
Contributor
Merge activity
|
…ent from `Allocator` (#21797) Refactor. Don't hard-code the minimum alignment of `Arena` chunks in `apps/oxlint` and `napi/parser`. Get the value from a property on `Allocator`. This will avoid this code getting out of sync if the value changes in future. Also rename the vars `BUMP_ALIGN` to `ARENA_ALIGN`, as the arena type is now called `Arena` not `Bump`, and update some comments which were out of date.
8fb23df to
94a41eb
Compare
d1e4c50 to
a7521cb
Compare
Base automatically changed from
om/04-26-refactor_allocator_clarify_max_calculations_in_arena_
to
main
April 26, 2026 22:14
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Refactor.
Don't hard-code the minimum alignment of
Arenachunks inapps/oxlintandnapi/parser. Get the value from a property onAllocator. This will avoid this code getting out of sync if the value changes in future.Also rename the vars
BUMP_ALIGNtoARENA_ALIGN, as the arena type is now calledArenanotBump, and update some comments which were out of date.