Skip to content

Commit cd58091

Browse files
authored
gh-106023: Remove _PY_FASTCALL_SMALL_STACK constant (#106258)
Remove _PY_FASTCALL_SMALL_STACK constant from the C API: move it to the internal C API (pycore_call.h).
1 parent 8c5f74f commit cd58091

File tree

2 files changed

+12
-13
lines changed

2 files changed

+12
-13
lines changed

Include/cpython/abstract.h

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,6 @@
22
# error "this header file must not be included directly"
33
#endif
44

5-
/* === Object Protocol ================================================== */
6-
7-
/* Suggested size (number of positional arguments) for arrays of PyObject*
8-
allocated on a C stack to avoid allocating memory on the heap memory. Such
9-
array is used to pass positional arguments to call functions of the
10-
PyObject_Vectorcall() family.
11-
12-
The size is chosen to not abuse the C stack and so limit the risk of stack
13-
overflow. The size is also chosen to allow using the small stack for most
14-
function calls of the Python standard library. On 64-bit CPU, it allocates
15-
40 bytes on the stack. */
16-
#define _PY_FASTCALL_SMALL_STACK 5
17-
185
/* === Vectorcall protocol (PEP 590) ============================= */
196

207
// PyVectorcall_NARGS() is exported as a function for the stable ABI.

Include/internal/pycore_call.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,18 @@ extern "C" {
1010

1111
#include "pycore_pystate.h" // _PyThreadState_GET()
1212

13+
/* Suggested size (number of positional arguments) for arrays of PyObject*
14+
allocated on a C stack to avoid allocating memory on the heap memory. Such
15+
array is used to pass positional arguments to call functions of the
16+
PyObject_Vectorcall() family.
17+
18+
The size is chosen to not abuse the C stack and so limit the risk of stack
19+
overflow. The size is also chosen to allow using the small stack for most
20+
function calls of the Python standard library. On 64-bit CPU, it allocates
21+
40 bytes on the stack. */
22+
#define _PY_FASTCALL_SMALL_STACK 5
23+
24+
1325
// Export for shared stdlib extensions like the math extension,
1426
// function used via inlined _PyObject_VectorcallTstate() function.
1527
PyAPI_FUNC(PyObject*) _Py_CheckFunctionResult(

0 commit comments

Comments
 (0)