Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commit88562ec

Browse files
committed
Fix up list iteration for FT build
1 parentaa62e39 commit88562ec

File tree

4 files changed

+6
-12
lines changed

4 files changed

+6
-12
lines changed

‎Python/bytecodes.c

Lines 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
#ifdefPy_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

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎Python/generated_cases.c.h

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎Python/specialize.c

Lines 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
#ifdefPy_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
gotofailure;
2911+
}
29152912
#endif
29162913
if (PyStackRef_IsNull(null_or_index)) {
29172914
if (tp==&PyRangeIter_Type) {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp