Implement rbimpl_atomic_value_load

This only adds the rbimpl_ version to include/ruby/atomic.h so that it
is not a new public interface.

We were already using RUBY_ATOMIC_VALUE_LOAD in a few locations. This
will allow us to use other memory orders internally when desired.
This commit is contained in:
John Hawthorn 2025-07-28 23:24:11 -07:00
parent 77d29ef73c
commit cb360b0b4b
2 changed files with 10 additions and 1 deletions

View file

@ -3,7 +3,7 @@
#include "ruby/atomic.h"
#define RUBY_ATOMIC_VALUE_LOAD(x) (VALUE)(RUBY_ATOMIC_PTR_LOAD(x))
#define RUBY_ATOMIC_VALUE_LOAD(x) rbimpl_atomic_value_load(&(x), RBIMPL_ATOMIC_SEQ_CST)
/* shim macros only */
#define ATOMIC_ADD(var, val) RUBY_ATOMIC_ADD(var, val)