summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorPablo Galindo <Pablogsal@gmail.com>2020-03-02 23:55:20 (GMT)
committerGitHub <noreply@github.com>2020-03-02 23:55:20 (GMT)
commit9ddcb914f9c2debe7c1359b2450cd1573e86b91c (patch)
tree1967dd5ab55fd5eab0193f042481ec054c655684 /Objects
parent7ad99821d8ae75222c50e69194a39f535bb058f5 (diff)
downloadcpython-9ddcb914f9c2debe7c1359b2450cd1573e86b91c.zip
cpython-9ddcb914f9c2debe7c1359b2450cd1573e86b91c.tar.gz
cpython-9ddcb914f9c2debe7c1359b2450cd1573e86b91c.tar.bz2
[3.8] bpo-39778: Don't traverse weak-reference lists OrderedDict's tp_traverse and tp_clear (GH-18749) (GH-18756)
Objects do not own weak references to them directly through the __weakref__ list so these do not need to be traversed by the GC. (cherry picked from commit 0c2b509)
Diffstat (limited to 'Objects')
-rw-r--r--Objects/odictobject.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/Objects/odictobject.c b/Objects/odictobject.c
index 4c9ae3b..ac0da9b 100644
--- a/Objects/odictobject.c
+++ b/Objects/odictobject.c
@@ -1453,7 +1453,6 @@ odict_traverse(PyODictObject *od, visitproc visit, void *arg)
_ODictNode *node;
Py_VISIT(od->od_inst_dict);
- Py_VISIT(od->od_weakreflist);
_odict_FOREACH(od, node) {
Py_VISIT(_odictnode_KEY(node));
}
@@ -1466,7 +1465,6 @@ static int
odict_tp_clear(PyODictObject *od)
{
Py_CLEAR(od->od_inst_dict);
- Py_CLEAR(od->od_weakreflist);
PyDict_Clear((PyObject *)od);
_odict_clear_nodes(od);
return 0;