diff options
author | Bogdan Romanyuk <65823030+wrongnull@users.noreply.github.com> | 2024-12-30 20:38:49 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-30 20:38:49 (GMT) |
commit | 47d2cb8eb7595df5940225867dbb66b6dd59413a (patch) | |
tree | 56eea4661785e619f8b63541598c5efe88c41191 /Objects | |
parent | fe4dd07a84ba423179a93ed84bdcc2b4c99b35a9 (diff) | |
download | cpython-47d2cb8eb7595df5940225867dbb66b6dd59413a.zip cpython-47d2cb8eb7595df5940225867dbb66b6dd59413a.tar.gz cpython-47d2cb8eb7595df5940225867dbb66b6dd59413a.tar.bz2 |
gh-128100: Use atomic dictionary load in `_PyObject_GenericGetAttrWithDict` (GH-128297)
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/object.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Objects/object.c b/Objects/object.c index d584414..4c30257 100644 --- a/Objects/object.c +++ b/Objects/object.c @@ -1717,7 +1717,11 @@ _PyObject_GenericGetAttrWithDict(PyObject *obj, PyObject *name, else { PyObject **dictptr = _PyObject_ComputedDictPointer(obj); if (dictptr) { +#ifdef Py_GIL_DISABLED + dict = _Py_atomic_load_ptr_acquire(dictptr); +#else dict = *dictptr; +#endif } } } |