diff options
author | Victor Stinner <vstinner@python.org> | 2022-01-27 03:00:55 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-27 03:00:55 +0100 |
commit | af32b3ef1fbad3c2242627a14398320960a0cb45 (patch) | |
tree | 350016f513e2ebbdae51ee1e033f668dc2d3f609 /Modules/gcmodule.c | |
parent | f0a648152f2d8011f47cc49873438ebaf01d3f82 (diff) | |
download | cpython-git-af32b3ef1fbad3c2242627a14398320960a0cb45.tar.gz |
bpo-40170: PyType_SUPPORTS_WEAKREFS() becomes a regular function (GH-30938)
Convert the PyType_SUPPORTS_WEAKREFS() macro to a regular function.
It no longer access the PyTypeObject.tp_weaklistoffset member
directly.
Add _PyType_SUPPORTS_WEAKREFS() static inline functions, used
internally by Python for best performance.
Diffstat (limited to 'Modules/gcmodule.c')
-rw-r--r-- | Modules/gcmodule.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/gcmodule.c b/Modules/gcmodule.c index 16f8c2b18e..802c3eadcc 100644 --- a/Modules/gcmodule.c +++ b/Modules/gcmodule.c @@ -791,7 +791,7 @@ handle_weakrefs(PyGC_Head *unreachable, PyGC_Head *old) _PyWeakref_ClearRef((PyWeakReference *)op); } - if (! PyType_SUPPORTS_WEAKREFS(Py_TYPE(op))) + if (! _PyType_SUPPORTS_WEAKREFS(Py_TYPE(op))) continue; /* It supports weakrefs. Does it have any? */ |