diff options
author | Sam Gross <colesbury@gmail.com> | 2023-09-21 20:57:20 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-21 20:57:20 (GMT) |
commit | 2aceb21ae61b4648b47afd9f8fdba8c106a745d0 (patch) | |
tree | 27ec88d087a8fdee1e74096501cccf30a6b3a78b /Objects/unicodeobject.c | |
parent | 5b8f0246834f211db0ea83b89277489abc2521ed (diff) | |
download | cpython-2aceb21ae61b4648b47afd9f8fdba8c106a745d0.zip cpython-2aceb21ae61b4648b47afd9f8fdba8c106a745d0.tar.gz cpython-2aceb21ae61b4648b47afd9f8fdba8c106a745d0.tar.bz2 |
gh-109693: Remove pycore_atomic_funcs.h (#109694)
_PyUnicode_FromId() now uses pyatomic.h functions instead.
Diffstat (limited to 'Objects/unicodeobject.c')
-rw-r--r-- | Objects/unicodeobject.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 4b87bf8..aca28e4 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -40,7 +40,6 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "Python.h" #include "pycore_abstract.h" // _PyIndex_Check() -#include "pycore_atomic_funcs.h" // _Py_atomic_size_get() #include "pycore_bytes_methods.h" // _Py_bytes_lower() #include "pycore_bytesobject.h" // _PyBytes_Repeat() #include "pycore_ceval.h" // _PyEval_GetBuiltin() @@ -1906,19 +1905,19 @@ _PyUnicode_FromId(_Py_Identifier *id) PyInterpreterState *interp = _PyInterpreterState_GET(); struct _Py_unicode_ids *ids = &interp->unicode.ids; - Py_ssize_t index = _Py_atomic_size_get(&id->index); + Py_ssize_t index = _Py_atomic_load_ssize(&id->index); if (index < 0) { struct _Py_unicode_runtime_ids *rt_ids = &interp->runtime->unicode_state.ids; PyThread_acquire_lock(rt_ids->lock, WAIT_LOCK); // Check again to detect concurrent access. Another thread can have // initialized the index while this thread waited for the lock. - index = _Py_atomic_size_get(&id->index); + index = _Py_atomic_load_ssize(&id->index); if (index < 0) { assert(rt_ids->next_index < PY_SSIZE_T_MAX); index = rt_ids->next_index; rt_ids->next_index++; - _Py_atomic_size_set(&id->index, index); + _Py_atomic_store_ssize(&id->index, index); } PyThread_release_lock(rt_ids->lock); } |