mirror of
https://github.com/ruby/ruby.git
synced 2026-08-06 12:47:56 +08:00
pow5mult's b_cache publishes new cache nodes with ATOMIC_PTR_CAS (release), but both readers -- the fast-path check and the recheck before allocating -- were plain loads racing with that CAS: a data race in the C11 sense, and what TSan reports as `race:pow5mult` under parallel Ractor float<->string conversion. Harmless on current targets (the reader dereferences through the loaded pointer, so address dependency orders the accesses), but easy to make formally correct: read the cache head/next through RUBY_ATOMIC_PTR_LOAD. The lock-free CAS scheme is unchanged. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>