summaryrefslogtreecommitdiffstats
path: root/Objects/abstract.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2017-01-11 00:07:03 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2017-01-11 00:07:03 (GMT)
commitb915bc354e57889a93943159a6a238e0c9c20daa (patch)
tree7cf61914c530a1c0eab2c1fa4bad18d98a7a059b /Objects/abstract.c
parent415c5107be9873aba3a0619d7bf5096cfb5b087e (diff)
downloadcpython-b915bc354e57889a93943159a6a238e0c9c20daa.zip
cpython-b915bc354e57889a93943159a6a238e0c9c20daa.tar.gz
cpython-b915bc354e57889a93943159a6a238e0c9c20daa.tar.bz2
Disable _PyStack_AsTuple() inlining
Issue #29234: Inlining _PyStack_AsTuple() into callers increases their stack consumption, Disable inlining to optimize the stack consumption. Add _Py_NO_INLINE: use __attribute__((noinline)) of GCC and Clang. It reduces the stack consumption, bytes per call, before => after: test_python_call: 1040 => 976 (-64 B) test_python_getitem: 976 => 912 (-64 B) test_python_iterator: 1120 => 1056 (-64 B) => total: 3136 => 2944 (- 192 B)
Diffstat (limited to 'Objects/abstract.c')
-rw-r--r--Objects/abstract.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Objects/abstract.c b/Objects/abstract.c
index 93bf87f..5726160 100644
--- a/Objects/abstract.c
+++ b/Objects/abstract.c
@@ -2256,7 +2256,9 @@ PyObject_Call(PyObject *callable, PyObject *args, PyObject *kwargs)
return _Py_CheckFunctionResult(callable, result, NULL);
}
-PyObject*
+/* Issue #29234: Inlining _PyStack_AsTuple() into callers increases their
+ stack consumption, Disable inlining to optimize the stack consumption. */
+PyObject* _Py_NO_INLINE
_PyStack_AsTuple(PyObject **stack, Py_ssize_t nargs)
{
PyObject *args;