Skip to content

Commit

Permalink
Use _PyFrame_GetLocalsArray
Browse files Browse the repository at this point in the history
  • Loading branch information
colesbury committed Aug 13, 2024
1 parent 44d7dff commit 5b9176b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions Python/gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -537,10 +537,10 @@ visit_decref(PyObject *op, void *parent)
int
_PyGC_VisitFrameStack(_PyInterpreterFrame *frame, visitproc visit, void *arg)
{
_PyStackRef *i = frame->localsplus;
_PyStackRef *ref = _PyFrame_GetLocalsArray(frame);
/* locals and stack */
for (; i < frame->stackpointer; i++) {
Py_VISIT(PyStackRef_AsPyObjectBorrow(*i));
for (; ref < frame->stackpointer; ref++) {
Py_VISIT(PyStackRef_AsPyObjectBorrow(*ref));
}
return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion Python/gc_free_threading.c
Original file line number Diff line number Diff line change
Expand Up @@ -954,7 +954,7 @@ visit_decref_unreachable(PyObject *op, void *data)
int
_PyGC_VisitFrameStack(_PyInterpreterFrame *frame, visitproc visit, void *arg)
{
_PyStackRef *ref = frame->localsplus;
_PyStackRef *ref = _PyFrame_GetLocalsArray(frame);
/* locals and stack */
for (; ref < frame->stackpointer; ref++) {
// This is a bit tricky! We want to ignore deferred references when
Expand Down

0 comments on commit 5b9176b

Please sign in to comment.