Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-111926: Avoid locking in PyType_IsSubtype #117275

Merged
merged 5 commits into from
Mar 29, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Done add tuples tagged for delayed reclamation to free lists
  • Loading branch information
mpage committed Mar 28, 2024
commit 0ee1aa3a3c60af9e8af935dbd201b6a2b6fd569b
7 changes: 7 additions & 0 deletions Objects/tupleobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -1161,6 +1161,13 @@ static inline int
maybe_freelist_push(PyTupleObject *op)
{
#ifdef WITH_FREELISTS
#ifdef Py_GIL_DISABLED
if (_PyObject_GC_IS_SHARED_INLINE((PyObject *) op)) {
// There may still be threads that are concurrently reading from the
// tuple.
return 0;
}
#endif
mpage marked this conversation as resolved.
Show resolved Hide resolved
struct _Py_object_freelists *freelists = _Py_object_freelists_GET();
if (Py_SIZE(op) == 0) {
return 0;
Expand Down
Loading