summaryrefslogtreecommitdiff
path: root/ruby_atomic.h
diff options
context:
space:
mode:
authorJohn Hawthorn <john@hawthorn.email>2025-07-28 23:22:34 -0700
committerJohn Hawthorn <john@hawthorn.email>2025-08-12 10:38:00 -0700
commit77d29ef73cba81e7c18ab9bb95e0756b9f173f38 (patch)
treed7a492e06ad9b2ac771b41f13438517088931d82 /ruby_atomic.h
parent1d9f76096e8072bf4fa4e2eb22d02079e1cbe429 (diff)
Convert ATOMIC_LOAD_RELAXED to use new rbimpl_*
Diffstat (limited to 'ruby_atomic.h')
-rw-r--r--ruby_atomic.h11
1 files changed, 1 insertions, 10 deletions
diff --git a/ruby_atomic.h b/ruby_atomic.h
index 1ccabcbdf6..2923275636 100644
--- a/ruby_atomic.h
+++ b/ruby_atomic.h
@@ -27,16 +27,7 @@
#define ATOMIC_VALUE_CAS(var, oldval, val) RUBY_ATOMIC_VALUE_CAS(var, oldval, val)
#define ATOMIC_VALUE_EXCHANGE(var, val) RUBY_ATOMIC_VALUE_EXCHANGE(var, val)
-static inline rb_atomic_t
-rbimpl_atomic_load_relaxed(volatile rb_atomic_t *ptr)
-{
-#if defined(HAVE_GCC_ATOMIC_BUILTINS)
- return __atomic_load_n(ptr, __ATOMIC_RELAXED);
-#else
- return *ptr;
-#endif
-}
-#define ATOMIC_LOAD_RELAXED(var) rbimpl_atomic_load_relaxed(&(var))
+#define ATOMIC_LOAD_RELAXED(var) rbimpl_atomic_load(&(var), RBIMPL_ATOMIC_RELAXED)
typedef RBIMPL_ALIGNAS(8) uint64_t rbimpl_atomic_uint64_t;