8000 gh-128100: Use atomic dictionary load in `_PyObject_GenericGetAttrWit… · python/cpython@47d2cb8 · GitHub
[go: up one dir, main page]

Skip to content

Commit 47d2cb8

Browse files
authored
gh-128100: Use atomic dictionary load in _PyObject_GenericGetAttrWithDict (GH-128297)
1 parent fe4dd07 commit 47d2cb8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Objects/object.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1717,7 +1717,11 @@ _PyObject_GenericGetAttrWithDict(PyObject *obj, PyObject *name,
17171717
else {
17181718
PyObject **dictptr = _PyObject_ComputedDictPointer(obj);
17191719
if (dictptr) {
1720+
#ifdef Py_GIL_DISABLED
1721+
dict = _Py_atomic_load_ptr_acquire(dictptr);
1722+
#else
17201723
dict = *dictptr;
1724+
#endif
17211725
}
17221726
}
17231727
}

0 commit comments

Comments
 (0)
0