Add _PY_FASTCALL_SMALL_STACK constant

Issue #28870: Add a new _PY_FASTCALL_SMALL_STACK constant, size of "small
stacks" allocated on the C stack to pass positional arguments to
_PyObject_FastCall().

_PyObject_Call_Prepend() now uses a small stack of 5 arguments (40 bytes)
instead of 8 (64 bytes), since it is modified to use _PY_FASTCALL_SMALL_STACK.
This commit is contained in:
Victor Stinner 2016-12-15 12:40:53 +01:00
parent d1e35dd9ee
commit bc08ab4598
3 changed files with 15 additions and 4 deletions

View file

@ -1186,7 +1186,7 @@ map_traverse(mapobject *lz, visitproc visit, void *arg)
static PyObject *
map_next(mapobject *lz)
{
PyObject *small_stack[5];
PyObject *small_stack[_PY_FASTCALL_SMALL_STACK];
PyObject **stack;
Py_ssize_t niters, nargs, i;
PyObject *result = NULL;