summaryrefslogtreecommitdiffstats
path: root/Include/cpython
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2023-08-17 10:16:03 (GMT)
committerGitHub <noreply@github.com>2023-08-17 10:16:03 (GMT)
commit006e44f9502308ec3d14424ad8bd774046f2be8e (patch)
tree91ab71678a0fb5f5ba410c371f28ded8a1c82d0d /Include/cpython
parent33e6e3fec02ff3035dec52692542d3dd10124bef (diff)
downloadcpython-006e44f9502308ec3d14424ad8bd774046f2be8e.zip
cpython-006e44f9502308ec3d14424ad8bd774046f2be8e.tar.gz
cpython-006e44f9502308ec3d14424ad8bd774046f2be8e.tar.bz2
GH-108035: Remove the `_PyCFrame` struct as it is no longer needed for performance. (GH-108036)
Diffstat (limited to 'Include/cpython')
-rw-r--r--Include/cpython/pystate.h25
1 files changed, 2 insertions, 23 deletions
diff --git a/Include/cpython/pystate.h b/Include/cpython/pystate.h
index 56e473c..2a53838 100644
--- a/Include/cpython/pystate.h
+++ b/Include/cpython/pystate.h
@@ -29,24 +29,6 @@ typedef int (*Py_tracefunc)(PyObject *, PyFrameObject *, int, PyObject *);
#define PyTrace_C_RETURN 6
#define PyTrace_OPCODE 7
-// Internal structure: you should not use it directly, but use public functions
-// like PyThreadState_EnterTracing() and PyThreadState_LeaveTracing().
-typedef struct _PyCFrame {
- /* This struct will be threaded through the C stack
- * allowing fast access to per-thread state that needs
- * to be accessed quickly by the interpreter, but can
- * be modified outside of the interpreter.
- *
- * WARNING: This makes data on the C stack accessible from
- * heap objects. Care must be taken to maintain stack
- * discipline and make sure that instances of this struct cannot
- * accessed outside of their lifetime.
- */
- /* Pointer to the currently executing frame (it can be NULL) */
- struct _PyInterpreterFrame *current_frame;
- struct _PyCFrame *previous;
-} _PyCFrame;
-
typedef struct _err_stackitem {
/* This struct represents a single execution context where we might
* be currently handling an exception. It is a per-coroutine state
@@ -123,9 +105,8 @@ struct _ts {
int tracing;
int what_event; /* The event currently being monitored, if any. */
- /* Pointer to current _PyCFrame in the C stack frame of the currently,
- * or most recently, executing _PyEval_EvalFrameDefault. */
- _PyCFrame *cframe;
+ /* Pointer to currently executing frame. */
+ struct _PyInterpreterFrame *current_frame;
Py_tracefunc c_profilefunc;
Py_tracefunc c_tracefunc;
@@ -211,8 +192,6 @@ struct _ts {
/* The thread's exception stack entry. (Always the last entry.) */
_PyErr_StackItem exc_state;
- /* The bottom-most frame on the stack. */
- _PyCFrame root_cframe;
};
/* WASI has limited call stack. Python's recursion limit depends on code