[issue4941] Tell GCC Py_DECREF is unlikely to call the destructor

Paolo 'Blaisorblade' Giarrusso report at bugs.python.org
Mon Jan 26 12:53:14 CET 2009


Paolo 'Blaisorblade' Giarrusso <p.giarrusso at gmail.com> added the comment:

>Probably #if the definitions of Py_LIKELY and Py_UNLIKELY instead of
__builtin_expect so new compilers can easily add their own definitions.

This was done in the first version, but with the currently supported
compilers it's simpler to do like that, because both GCC and ICC support
the same __builtin_expect syntax, so you get less code this way.

Anyway, the code was "inspired" from the Linux kernel which only
supports those two compilers, so anybody more knowledgeable is welcome
to suggest how to express this with other compilers.

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue4941>
_______________________________________


More information about the Python-bugs-list mailing list