-
-
Notifications
You must be signed in to change notification settings - Fork 720
refactor(allocator): do not make Allocator::bump field public
#12936
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(allocator): do not make Allocator::bump field public
#12936
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.
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 Allocator struct to avoid exposing the bump field publicly when the track_allocations feature is enabled. The field offset calculations for allocation tracking are moved from the Alloc trait implementation to constants defined next to the Allocator struct.
Key changes:
- Remove conditional public visibility of the
bumpfield inAllocator - Add pre-calculated offset constants
NUM_ALLOC_FIELD_OFFSETandNUM_REALLOC_FIELD_OFFSET - Simplify allocation tracking code by using these constants instead of inline calculations
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| crates/oxc_allocator/src/allocator.rs | Removes public visibility of bump field and adds offset constants for allocation tracking |
| crates/oxc_allocator/src/alloc.rs | Updates allocation tracking code to use pre-calculated offset constants |
CodSpeed Instrumentation Performance ReportMerging #12936 will not alter performanceComparing Summary
Footnotes |
Merge activity
|
Follow-on after #12555. Avoid making `bump` field of `Allocator` public when `track_allocations` feature is enabled, by moving the field offset calculations to next to `Allocator`'s definition.
71ab71e to
ff1d93b
Compare
…project#12936) Follow-on after oxc-project#12555. Avoid making `bump` field of `Allocator` public when `track_allocations` feature is enabled, by moving the field offset calculations to next to `Allocator`'s definition.

Follow-on after #12555.
Avoid making
bumpfield ofAllocatorpublic whentrack_allocationsfeature is enabled, by moving the field offset calculations to next toAllocator's definition.