8000 Allow volatile pointer relaxed atomic operations · ruby/ruby@9f112af · GitHub
[go: up one dir, main page]

Skip to content

Commit 9f112af

Browse files
committed
Allow volatile pointer relaxed atomic operations
1 parent 9e84a27 commit 9f112af

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ruby_atomic.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#define ATOMIC_VALUE_EXCHANGE(var, val) RUBY_ATOMIC_VALUE_EXCHANGE(var, val)
2727

2828
static inline rb_atomic_t
29-
rbimpl_atomic_load_relaxed(rb_atomic_t *ptr)
29+
rbimpl_atomic_load_relaxed(volatile rb_atomic_t *ptr)
3030
{
3131
#if defined(HAVE_GCC_ATOMIC_BUILTINS)
3232
return __atomic_load_n(ptr, __ATOMIC_RELAXED);
@@ -37,7 +37,7 @@ rbimpl_atomic_load_relaxed(rb_atomic_t *ptr)
3737
#define ATOMIC_LOAD_RELAXED(var) rbimpl_atomic_load_relaxed(&(var))
3838

3939
static inline uint64_t
40-
rbimpl_atomic_u64_load_relaxed(const uint64_t *value)
40+
rbimpl_atomic_u64_load_relaxed(const volatile uint64_t *value)
4141
{
4242
#if defined(HAVE_GCC_ATOMIC_BUILTINS_64)
4343
return __atomic_load_n(value, __ATOMIC_RELAXED);
@@ -54,7 +54,7 @@ rbimpl_atomic_u64_load_relaxed(const uint64_t *value)
5454
#define ATOMIC_U64_LOAD_RELAXED(var) rbimpl_atomic_u64_load_relaxed(&(var))
5555

5656
static inline void
57-
rbimpl_atomic_u64_set_relaxed(uint64_t *address, uint64_t value)
57+
rbimpl_atomic_u64_set_relaxed(volatile uint64_t *address, uint64_t value)
5858
{
5959
#if defined(HAVE_GCC_ATOMIC_BUILTINS_64)
6060
__atomic_store_n(address, value, __ATOMIC_RELAXED);

0 commit comments

Comments
 (0)
0