[Python-Dev] Py_SETREF vs. Py_XSETREF
storchaka at gmail.com
Sun Apr 3 03:32:19 EDT 2016
Originally I proposed a pair of macros for safe reference replacing to
reflects the duality of Py_DECREF/Py_XDECREF. ,  The one should
use Py_DECREF and the other should use Py_XDECREF.
But then I got a number of voices for the single name , and no one
voice (except mine) for the pair of names. Thus in final patches the
single name Py_SETREF that uses Py_XDECREF is used. Due to adding some
overhead in comparison with using Py_DECREF, this macros is not used in
critical performance code such as PyDict_SetItem().
Now Raymond says that we should have separate Py_SETREF/Py_XSETREF names
to avoid any overhead.  And so I'm raising this issue on Python-Dev.
Should we rename Py_SETREF to Py_XSETREF and introduce new Py_SETREF
that uses Py_DECREF?
More information about the Python-Dev