[Python-Dev] Py_SETREF again (original) (raw)
Serhiy Storchaka storchaka at gmail.com
Fri Feb 12 09:19:13 EST 2016
- Previous message (by thread): [Python-Dev] Py_SETREF again
- Next message (by thread): [Python-Dev] [ANN] MicroPython 1.6
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 12.02.16 15:43, Georg Brandl wrote:
On 02/12/2016 10:45 AM, Serhiy Storchaka wrote:
Sorry to bringing this up again. I was hoping we were done with that.
When discussing the name of the PySETREF macro I was supposed to add a pair of macros: for PyDECREF and PyXDECREF. But I got a lot of opinions to be limited to only one macro. There was no (besides my) clearly expressed vote for two macros. I would have voted in favor. Spelling the SETREF out, as Nick proposes, kind of defies the purpose of the macro: it's not strictly a convenience macro, it helps prevent refcounting bugs. As a result I have replaced both PyDECREF and PyXDECREF with the macro that always uses PyXDECREF. Can you roughly say which fraction of replacements changed DECREF to an implicit XDECREF?
Changesets c4e8751ce637, bc7c56a225de, 539ba7267701, b02d256b8827, 1118dfcbcc35. Rough estimation:
Py_DECREF - 62 Py_XDECREF - 57 Py_CLEAR - 46
Total statistic of using macros in current code:
Py_SETREF 174 2.5% Py_CLEAR 781 11% Py_XDECREF 1443 20.5% Py_DECREF 4631 66%
- Previous message (by thread): [Python-Dev] Py_SETREF again
- Next message (by thread): [Python-Dev] [ANN] MicroPython 1.6
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]