Skip to content

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Aug 9, 2025

Follow-on after #12555. Pure refactor.

Move code related to allocation tracking into its own module, and introduce an AllocationStats struct.

This reduces noise in allocator.rs and alloc.rs, with less repetitions of #[cfg(all(feature = "track_allocations", not(feature = "disable_track_allocations")))] etc.

Also bulk out the doc comments explaining the unsoundness, and how we must take care to avoid allocation tracking code being compiled in production code.

Copy link
Member Author

overlookmotel commented Aug 9, 2025


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 hot fixes, skip the queue and merge this PR next

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 the C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior label Aug 9, 2025
@codspeed-hq
Copy link

codspeed-hq bot commented Aug 9, 2025

CodSpeed Instrumentation Performance Report

Merging #12937 will not alter performance

Comparing 08-09-refactor_allocator_move_allocation_tracking_code_into_own_module (4f31b73) with main (2c303f5)1

Summary

✅ 34 untouched benchmarks

Footnotes

  1. No successful run was found on main (4f31b73) during the generation of this report, so 2c303f5 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@overlookmotel overlookmotel marked this pull request as ready for review August 9, 2025 13:30
@overlookmotel overlookmotel requested a review from camchenry August 9, 2025 13:32
@overlookmotel overlookmotel added the 0-merge Merge with Graphite Merge Queue label Aug 9, 2025
Copy link
Member Author

overlookmotel commented Aug 9, 2025

Merge activity

@overlookmotel
Copy link
Member Author

Thanks for swift review @camchenry.

…12937)

Follow-on after #12555. Pure refactor.

Move code related to allocation tracking into its own module, and introduce an `AllocationStats` struct.

This reduces noise in `allocator.rs` and `alloc.rs`, with less repetitions of `#[cfg(all(feature = "track_allocations", not(feature = "disable_track_allocations")))]` etc.

Also bulk out the doc comments explaining the unsoundness, and how we must take care to avoid allocation tracking code being compiled in production code.
@graphite-app graphite-app bot force-pushed the 08-09-refactor_allocator_do_not_make_allocator_bump_field_public branch from 71ab71e to ff1d93b Compare August 9, 2025 14:24
@graphite-app graphite-app bot force-pushed the 08-09-refactor_allocator_move_allocation_tracking_code_into_own_module branch from 6e5f7b8 to 4f31b73 Compare August 9, 2025 14:24
Base automatically changed from 08-09-refactor_allocator_do_not_make_allocator_bump_field_public to main August 9, 2025 14:29
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Aug 9, 2025
@graphite-app graphite-app bot merged commit 4f31b73 into main Aug 9, 2025
27 checks passed
@graphite-app graphite-app bot deleted the 08-09-refactor_allocator_move_allocation_tracking_code_into_own_module branch August 9, 2025 14:29
taearls pushed a commit to taearls/oxc that referenced this pull request Aug 12, 2025
…xc-project#12937)

Follow-on after oxc-project#12555. Pure refactor.

Move code related to allocation tracking into its own module, and introduce an `AllocationStats` struct.

This reduces noise in `allocator.rs` and `alloc.rs`, with less repetitions of `#[cfg(all(feature = "track_allocations", not(feature = "disable_track_allocations")))]` etc.

Also bulk out the doc comments explaining the unsoundness, and how we must take care to avoid allocation tracking code being compiled in production code.
graphite-app bot pushed a commit that referenced this pull request Aug 19, 2025
…ocationStats` (#13043)

`AllocationStats` (introduced in #12555 and #12937) previously had to contain `AtomicUsize`s because `Allocator` was `Sync`. #13033 removed the `Sync` impl for `Allocator`, so now there's no need for synchronization in `AllocationStats`, and these fields can be `Cell<usize>` instead.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

3 participants