diff options
author | Pablo Galindo <Pablogsal@gmail.com> | 2020-03-02 23:12:54 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-02 23:12:54 (GMT) |
commit | 0c2b509f9d1d3a9065bc62c2407e1dc2ed70e9c2 (patch) | |
tree | e4aa312203b373608f069a04d7ad7fd8a61951ea /Objects | |
parent | b3b9ade4a3d3fe00d933bcd8fc5c5c755d1024f9 (diff) | |
download | cpython-0c2b509f9d1d3a9065bc62c2407e1dc2ed70e9c2.zip cpython-0c2b509f9d1d3a9065bc62c2407e1dc2ed70e9c2.tar.gz cpython-0c2b509f9d1d3a9065bc62c2407e1dc2ed70e9c2.tar.bz2 |
bpo-39778: Don't traverse weak-reference lists OrderedDict's tp_traverse and tp_clear (GH-18749)
Objects do not own weak references to them directly through the __weakref__ list so these
do not need to be traversed by the GC.
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/odictobject.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/Objects/odictobject.c b/Objects/odictobject.c index f412220..6813cdd 100644 --- a/Objects/odictobject.c +++ b/Objects/odictobject.c @@ -1454,7 +1454,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)); } @@ -1467,7 +1466,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; |