[issue35059] Convert Py_INCREF() and PyObject_INIT() to inlined functions

STINNER Victor report at bugs.python.org
Thu Oct 25 03:34:03 EDT 2018


STINNER Victor <vstinner at redhat.com> added the comment:

I modified PR 10079 to add a Py_STATIC_INLINE(TYPE) macro:

* Use __attribute__((always_inline)) with GCC and clang
* Use __forceinline with MSVC

Tests on Linux, example:

"./configure --with-pydebug CC=clang CFLAGS="-O0" && make clean && make platform"

* Linux, gcc -O0: inlined
* Linux, clang -O0: inlined

Test done on Fedora 28 with GCC 8.1.1 and clang 6.0.1.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue35059>
_______________________________________


More information about the Python-bugs-list mailing list