Skip to content

Commit

Permalink
Immortal executors are not GC-able
Browse files Browse the repository at this point in the history
  • Loading branch information
gvanrossum committed Apr 23, 2024
1 parent 23950be commit 649148d
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions Python/optimizer.c
Original file line number Diff line number Diff line change
Expand Up @@ -397,10 +397,7 @@ executor_traverse(PyObject *o, visitproc visit, void *arg)
static int
executor_is_gc(PyObject *o)
{
if ((PyObject *)&COLD_EXITS[0] <= o && o < (PyObject *)&COLD_EXITS[COLD_EXIT_COUNT]) {
return 0;
}
return 1;
return !_Py_IsImmortal(o);
}

PyTypeObject _PyUOpExecutor_Type = {
Expand Down

0 comments on commit 649148d

Please sign in to comment.