Skip to content

refactor(allocator): use stabilized AtomicUsize::update#24382

Merged
graphite-app[bot] merged 1 commit into
mainfrom
refactor-atomic-update
Jul 11, 2026
Merged

refactor(allocator): use stabilized AtomicUsize::update#24382
graphite-app[bot] merged 1 commit into
mainfrom
refactor-atomic-update

Conversation

@Boshen

@Boshen Boshen commented Jul 11, 2026

Copy link
Copy Markdown
Member

Rust 1.95 stabilized Atomic*::update (MSRV bumped in #24359), the infallible sibling of fetch_update for closures that always produce a new value.

Both fetch_update call sites (oxc_allocator/src/tracking.rs and tasks/track_memory_allocations) used an always-Some closure, so they gain nothing from the fallible API — switching to update drops the ignored Result (let _ =) and the "cannot be Err" comments. Same CAS-loop semantics; saturating_add behavior unchanged.

🤖 Generated with Claude Code

@Boshen
Boshen requested a review from overlookmotel as a code owner July 11, 2026 10:50
@github-actions github-actions Bot added the A-allocator Area - Allocator label Jul 11, 2026
@codspeed-hq

codspeed-hq Bot commented Jul 11, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 62 untouched benchmarks
⏩ 9 skipped benchmarks1


Comparing refactor-atomic-update (81b11f1) with main (d117011)

Open in CodSpeed

Footnotes

  1. 9 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.

@overlookmotel overlookmotel added the 0-merge Merge with Graphite Merge Queue label Jul 11, 2026

overlookmotel commented Jul 11, 2026

Copy link
Copy Markdown
Member

Merge activity

Rust 1.95 stabilized [`Atomic*::update`](https://doc.rust-lang.org/std/sync/atomic/struct.AtomicUsize.html#method.update) (MSRV bumped in #24359), the infallible sibling of `fetch_update` for closures that always produce a new value.

Both `fetch_update` call sites (`oxc_allocator/src/tracking.rs` and `tasks/track_memory_allocations`) used an always-`Some` closure, so they gain nothing from the fallible API — switching to `update` drops the ignored `Result` (`let _ =`) and the "cannot be `Err`" comments. Same CAS-loop semantics; `saturating_add` behavior unchanged.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
@graphite-app
graphite-app Bot force-pushed the refactor-atomic-update branch from 81b11f1 to b889093 Compare July 11, 2026 17:40
@graphite-app
graphite-app Bot merged commit b889093 into main Jul 11, 2026
31 checks passed
@graphite-app graphite-app Bot removed the 0-merge Merge with Graphite Merge Queue label Jul 11, 2026
@graphite-app
graphite-app Bot deleted the refactor-atomic-update branch July 11, 2026 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-allocator Area - Allocator

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants