Skip to content

gh-103092: Isolate _collections #103093

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

Merged
merged 22 commits into from
Apr 12, 2023
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
Don't call PyDict_Type stuff directly from dealloc, traverse, and clear
erlend-aasland committed Apr 9, 2023

Verified

This commit was signed with the committer’s verified signature.
erlend-aasland Erlend E. Aasland
commit 45a26f3bed971d9d8a08bdf293e96f97b50dcabe
6 changes: 3 additions & 3 deletions Modules/_collectionsmodule.c
Original file line number Diff line number Diff line change
@@ -2067,7 +2067,7 @@ defdict_dealloc(defdictobject *dd)
PyTypeObject *tp = Py_TYPE(dd);
PyObject_GC_UnTrack(dd);
tp->tp_clear((PyObject *)dd);
PyDict_Type.tp_dealloc((PyObject *)dd);
tp->tp_free((PyObject *)dd);
Py_DECREF(tp);
}

@@ -2142,14 +2142,14 @@ defdict_traverse(PyObject *self, visitproc visit, void *arg)
{
Py_VISIT(Py_TYPE(self));
Py_VISIT(((defdictobject *)self)->default_factory);
return PyDict_Type.tp_traverse(self, visit, arg);
return 0;
}

static int
defdict_tp_clear(defdictobject *dd)
{
Py_CLEAR(dd->default_factory);
return PyDict_Type.tp_clear((PyObject *)dd);
return 0;
}

static int