https://github.com/python/cpython/commit/47d2cb8eb7595df5940225867dbb66b6dd59413a
commit: 47d2cb8eb7595df5940225867dbb66b6dd59413a
branch: main
author: Bogdan Romanyuk <[email protected]>
committer: colesbury <[email protected]>
date: 2024-12-30T20:38:49Z
summary:
gh-128100: Use atomic dictionary load in `_PyObject_GenericGetAttrWithDict`
(GH-128297)
files:
M Objects/object.c
diff --git a/Objects/object.c b/Objects/object.c
index d584414c559b9d..4c30257ca26938 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
}
}
}
_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]