Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 7e87d30

Browse filesBrowse 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
Copy full SHA for 7e87d30

File tree

1 file changed

+1
-4
lines changed
Filter options

1 file changed

+1
-4
lines changed

‎Python/optimizer.c

Copy file name to clipboardExpand all lines: Python/optimizer.c
+1-4Lines 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)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.