GH-108035: Remove the _PyCFrame struct as it is no longer needed for performance. (GH-108036)

This commit is contained in:
Mark Shannon 2023-08-17 11:16:03 +01:00 committed by GitHub
parent 33e6e3fec0
commit 006e44f950
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 66 additions and 103 deletions

View file

@ -1310,7 +1310,7 @@ init_threadstate(PyThreadState *tstate,
// This is cleared when PyGILState_Ensure() creates the thread state.
tstate->gilstate_counter = 1;
tstate->cframe = &tstate->root_cframe;
tstate->current_frame = NULL;
tstate->datastack_chunk = NULL;
tstate->datastack_top = NULL;
tstate->datastack_limit = NULL;
@ -1452,7 +1452,7 @@ PyThreadState_Clear(PyThreadState *tstate)
int verbose = _PyInterpreterState_GetConfig(tstate->interp)->verbose;
if (verbose && tstate->cframe->current_frame != NULL) {
if (verbose && tstate->current_frame != NULL) {
/* bpo-20526: After the main thread calls
_PyInterpreterState_SetFinalizing() in Py_FinalizeEx()
(or in Py_EndInterpreter() for subinterpreters),
@ -1953,7 +1953,7 @@ _PyThread_CurrentFrames(void)
for (i = runtime->interpreters.head; i != NULL; i = i->next) {
PyThreadState *t;
for (t = i->threads.head; t != NULL; t = t->next) {
_PyInterpreterFrame *frame = t->cframe->current_frame;
_PyInterpreterFrame *frame = t->current_frame;
frame = _PyFrame_GetFirstComplete(frame);
if (frame == NULL) {
continue;