8000 gh-118074: Immortal executors are not GC-able (#118182) · python/cpython@7e87d30 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7e87d30

Browse files
authored
gh-118074: Immortal executors are not GC-able (#118182)
Better version of gh-118117. Just check for immortality instead of an address range check.
1 parent 2584082 commit 7e87d30

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

Python/optimizer.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -397,10 +397,7 @@ executor_traverse(PyObject *o, visitproc visit, void *arg)
397397
static int
398398
executor_is_gc(PyObject *o)
399399
{
400-
if ((PyObject *)&COLD_EXITS[0] <= o && o < (PyObject *)&COLD_EXITS[COLD_EXIT_COUNT]) {
401-
return 0;
402-
}
403-
return 1;
400+
return !_Py_IsImmortal(o);
404401
}
405402

406403
PyTypeObject _PyUOpExecutor_Type = {

0 commit comments

Comments
 (0)
0