b732b7d9f2 (master): Avoid locked instructions for atomic loads on x64 Windows

0 views
Skip to first unread message

Hiroshi SHIBATA

unread,
Oct 5, 2026, 9:47:47 PM (20 hours ago) Oct 5
to ruby...@g.ruby-lang.org
Hiroshi SHIBATA 2026-10-05 23:32:41 +0000 (Mon, 05 Oct 2026)

New Revision: b732b7d9f2

https://github.com/ruby/ruby/commit/b732b7d9f2

Log:
Avoid locked instructions for atomic loads on x64 Windows

An aligned load is atomic on x64, and seq_cst because stores here use xchg. The fallbacks issued lock xadd or lock cmpxchg on every load, which RUBY_VM_CHECK_INTS and inline cache reads pay for. ARM64EC also defines _M_X64, so it is excluded.

Co-Authored-By: Claude Opus 5.5 <nor...@anthropic.com>

Modified files:
include/ruby/atomic.h
ruby_atomic.h
Reply all
Reply to author
Forward
0 new messages