Skip to content

Commit fcaee80

Browse files
committed
Remove additional frame initialization
1 parent 1ec055b commit fcaee80

File tree

1 file changed

+0
-17
lines changed

1 file changed

+0
-17
lines changed

Include/internal/pycore_frame.h

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -212,16 +212,6 @@ _PyFrame_Initialize(
212212
for (int i = null_locals_from; i < code->co_nlocalsplus; i++) {
213213
frame->localsplus[i] = PyStackRef_NULL;
214214
}
215-
216-
#ifdef Py_GIL_DISABLED
217-
// On GIL disabled, we walk the entire stack in GC. Since stacktop
218-
// is not always in sync with the real stack pointer, we have
219-
// no choice but to traverse the entire stack.
220-
// This just makes sure we don't pass the GC invalid stack values.
221-
for (int i = code->co_nlocalsplus; i < code->co_nlocalsplus + code->co_stacksize; i++) {
222-
frame->localsplus[i] = PyStackRef_NULL;
223-
}
224-
#endif
225215
}
226216

227217
/* Gets the pointer to the locals array
@@ -392,13 +382,6 @@ _PyFrame_PushTrampolineUnchecked(PyThreadState *tstate, PyCodeObject *code, int
392382
frame->owner = FRAME_OWNED_BY_THREAD;
393383
frame->visited = 0;
394384
frame->return_offset = 0;
395-
396-
#ifdef Py_GIL_DISABLED
397-
assert(code->co_nlocalsplus == 0);
398-
for (int i = 0; i < code->co_stacksize; i++) {
399-
frame->localsplus[i] = PyStackRef_NULL;
400-
}
401-
#endif
402385
return frame;
403386
}
404387

0 commit comments

Comments
 (0)