bpo-40170: PyObject_GET_WEAKREFS_LISTPTR() becomes a function by vstinner · Pull Request #19377 · python/cpython
Conversation
Convert PyObject_GET_WEAKREFS_LISTPTR() macro to a function to hide
implementation details: the macro accessed directly to
PyTypeObject.tp_weaklistoffset member.
PyObject_GET_WEAKREFS_LISTPTR() is used in the garbage collector.
If converting the macro into a regular function caused a performance overhead, we can add an internal macro / static inline function for Python internals.
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.
Thanks @pablogsal. I added a static inline function to the internal C API.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters