GeezerVison is showing github.com — Simplify code after merge · python/cpython@cd3d83d
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: Python/gc_free_threading.c +3-7Lines changed: 3 additions & 7 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -181,7 +181,7 @@ merge_refcount(PyObject *op, Py_ssize_t extra) |
181 | 181 | } |
182 | 182 |
|
183 | 183 | static void |
184 | | -frame_disable_deferred_refcounting(_PyInterpreterFrame *frame, int is_funcobj_valid) |
| 184 | +frame_disable_deferred_refcounting(_PyInterpreterFrame *frame) |
185 | 185 | { |
186 | 186 | // Convert locals, variables, and the executable object to strong |
187 | 187 | // references from (possibly) deferred references. |
@@ -232,14 +232,10 @@ disable_deferred_refcounting(PyObject *op) |
232 | 232 | // use strong references, in case the generator or frame object is |
233 | 233 | // resurrected by a finalizer. |
234 | 234 | if (PyGen_CheckExact(op) || PyCoro_CheckExact(op) || PyAsyncGen_CheckExact(op)) { |
235 | | - // The `f_funcobj` field is invalid if the frame is a cleared generator |
236 | | - PyGenObject *gen = (PyGenObject *)op; |
237 | | - int is_funcobj_valid = gen->gi_frame_state != FRAME_CLEARED; |
238 | | - |
239 | | - frame_disable_deferred_refcounting(&gen->gi_iframe, is_funcobj_valid); |
| 235 | + frame_disable_deferred_refcounting(&((PyGenObject *)op)->gi_iframe); |
240 | 236 | } |
241 | 237 | else if (PyFrame_Check(op)) { |
242 | | - frame_disable_deferred_refcounting(((PyFrameObject *)op)->f_frame, 1); |
| 238 | + frame_disable_deferred_refcounting(((PyFrameObject *)op)->f_frame); |
243 | 239 | } |
244 | 240 | } |
245 | 241 |
|
|