mirror of
https://github.com/python/cpython.git
synced 2025-11-02 03:01:58 +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
|
|
@ -788,7 +788,7 @@ handle_weakrefs(PyGC_Head *unreachable, PyGC_Head *old)
|
|||
|
||||
/* It supports weakrefs. Does it have any? */
|
||||
wrlist = (PyWeakReference **)
|
||||
PyObject_GET_WEAKREFS_LISTPTR(op);
|
||||
_PyObject_GET_WEAKREFS_LISTPTR(op);
|
||||
|
||||
/* `op` may have some weakrefs. March over the list, clear
|
||||
* all the weakrefs, and move the weakrefs with callbacks
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue