From af32b3ef1fbad3c2242627a14398320960a0cb45 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Thu, 27 Jan 2022 03:00:55 +0100 Subject: 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. --- Modules/gcmodule.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Modules/gcmodule.c') 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? */ -- cgit v1.2.1