File tree Expand file tree Collapse file tree 2 files changed +4
-10
lines changed Expand file tree Collapse file tree 2 files changed +4
-10
lines changed Original file line number Diff line number Diff line change @@ -115,6 +115,8 @@ extern "C" {
115115 _Py_atomic_load_ullong_relaxed(&value)
116116#define FT_ATOMIC_ADD_SSIZE (value , new_value ) \
117117 (void)_Py_atomic_add_ssize(&value, new_value)
118+ #define FT_ATOMIC_ADD_UINT64 (value , new_value ) \
119+ (void)_Py_atomic_add_uint64(&value, new_value)
118120
119121#else
120122#define FT_ATOMIC_LOAD_PTR (value ) value
Original file line number Diff line number Diff line change @@ -35,21 +35,13 @@ get_abc_state(PyObject *module)
3535static inline uint64_t
3636get_invalidation_counter (_abcmodule_state * state )
3737{
38- #ifdef Py_GIL_DISABLED
39- return _Py_atomic_load_uint64 (& state -> abc_invalidation_counter );
40- #else
41- return state -> abc_invalidation_counter ;
42- #endif
38+ return FT_ATOMIC_LOAD_UINT64_RELAXED (state -> abc_invalidation_counter );
4339}
4440
4541static inline void
4642increment_invalidation_counter (_abcmodule_state * state )
4743{
48- #ifdef Py_GIL_DISABLED
49- _Py_atomic_add_uint64 (& state -> abc_invalidation_counter , 1 );
50- #else
51- state -> abc_invalidation_counter ++ ;
52- #endif
44+ FT_ATOMIC_ADD_UINT64 (state -> abc_invalidation_counter , 1 );
5345}
5446
5547/* This object stores internal state for ABCs.
You can’t perform that action at this time.
0 commit comments