mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
bpo-40170: PyObject_GET_WEAKREFS_LISTPTR() becomes a function (GH-19377)
Convert the PyObject_GET_WEAKREFS_LISTPTR() macro to a function to hide implementation details: the macro accessed directly to the PyTypeObject.tp_weaklistoffset member. Add _PyObject_GET_WEAKREFS_LISTPTR() static inline function to the internal C API.
This commit is contained in:
parent
08050e959e
commit
38aefc585f
8 changed files with 25 additions and 6 deletions
|
@ -1271,7 +1271,7 @@ subtype_dealloc(PyObject *self)
|
|||
if (type->tp_weaklistoffset && !base->tp_weaklistoffset) {
|
||||
/* Modeled after GET_WEAKREFS_LISTPTR() */
|
||||
PyWeakReference **list = (PyWeakReference **) \
|
||||
PyObject_GET_WEAKREFS_LISTPTR(self);
|
||||
_PyObject_GET_WEAKREFS_LISTPTR(self);
|
||||
while (*list)
|
||||
_PyWeakref_ClearRef(*list);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue