Skip to content

Commit 7fe1a18

Browse files
authored
gh-130396: Remove _Py_ReachedRecursionLimitWithMargin() function (#141951)
Move the private function to the internal C API (pycore_ceval.h).
1 parent bc9e63d commit 7fe1a18

File tree

4 files changed

+6
-2
lines changed

4 files changed

+6
-2
lines changed

Include/cpython/object.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -436,8 +436,6 @@ PyAPI_FUNC(void) _Py_NO_RETURN _PyObject_AssertFailed(
436436
PyAPI_FUNC(void) _PyTrash_thread_deposit_object(PyThreadState *tstate, PyObject *op);
437437
PyAPI_FUNC(void) _PyTrash_thread_destroy_chain(PyThreadState *tstate);
438438

439-
PyAPI_FUNC(int) _Py_ReachedRecursionLimitWithMargin(PyThreadState *tstate, int margin_count);
440-
441439
/* For backwards compatibility with the old trashcan mechanism */
442440
#define Py_TRASHCAN_BEGIN(op, dealloc)
443441
#define Py_TRASHCAN_END

Include/internal/pycore_ceval.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,10 @@ static inline int _Py_ReachedRecursionLimit(PyThreadState *tstate) {
263263
#endif
264264
}
265265

266+
extern int _Py_ReachedRecursionLimitWithMargin(
267+
PyThreadState *tstate,
268+
int margin_count);
269+
266270
static inline void _Py_LeaveRecursiveCall(void) {
267271
}
268272

Parser/parser.c

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Tools/peg_generator/pegen/c_generator.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131

3232
EXTENSION_PREFIX = """\
3333
#include "pegen.h"
34+
#include "pycore_ceval.h"
3435
3536
#if defined(Py_DEBUG) && defined(Py_BUILD_CORE)
3637
# define D(x) if (p->debug) { x; }

0 commit comments

Comments
 (0)