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 88562ec

Browse filesBrowse files
committed
Fix up list iteration for FT build
1 parent aa62e39 commit 88562ec
Copy full SHA for 88562ec

File tree

Expand file treeCollapse file tree

4 files changed

+6
-12
lines changed
Filter options
Expand file treeCollapse file tree

4 files changed

+6
-12
lines changed

‎Python/bytecodes.c

Copy file name to clipboardExpand all lines: Python/bytecodes.c
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3202,8 +3202,7 @@ dummy_func(
32023202
EXIT_IF(Py_TYPE(iter_o) != &PyList_Type);
32033203
assert(PyStackRef_IsTaggedInt(null_or_index));
32043204
#ifdef Py_GIL_DISABLED
3205-
EXIT_IF(!_Py_IsOwnedByCurrentThread(iter_o) ||
3206-
!_PyObject_GC_IS_SHARED(iter_o));
3205+
EXIT_IF(!_Py_IsOwnedByCurrentThread(iter_o) && !_PyObject_GC_IS_SHARED(iter_o));
32073206
#endif
32083207
}
32093208

‎Python/executor_cases.c.h

Copy file name to clipboardExpand all lines: Python/executor_cases.c.h
+1-2Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Python/generated_cases.c.h

Copy file name to clipboardExpand all lines: Python/generated_cases.c.h
+1-2Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Python/specialize.c

Copy file name to clipboardExpand all lines: Python/specialize.c
+3-6Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2905,13 +2905,10 @@ _Py_Specialize_ForIter(_PyStackRef iter, _PyStackRef null_or_index, _Py_CODEUNIT
29052905
PyObject *iter_o = PyStackRef_AsPyObjectBorrow(iter);
29062906
PyTypeObject *tp = Py_TYPE(iter_o);
29072907
#ifdef Py_GIL_DISABLED
2908-
// Only specialize for uniquely referenced iterators, so that we know
2909-
// they're only referenced by this one thread. This is more limiting
2910-
// than we need (even `it = iter(mylist); for item in it:` won't get
2911-
// specialized) but we don't have a way to check whether we're the only
2912-
// _thread_ who has access to the object.
2913-
if (!_PyObject_IsUniquelyReferenced(iter_o))
2908+
// Only specialize for lists owned by this thread or shared
2909+
if (!_Py_IsOwnedByCurrentThread(iter_o) && !_PyObject_GC_IS_SHARED(iter_o)) {
29142910
goto failure;
2911+
}
29152912
#endif
29162913
if (PyStackRef_IsNull(null_or_index)) {
29172914
if (tp == &PyRangeIter_Type) {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.