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

Commit6c955e0

Browse files
committed
Fix up list iteration for FT build
1 parent981d8e9 commit6c955e0

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
@@ -3196,8 +3196,7 @@ dummy_func(
31963196
EXIT_IF(Py_TYPE(iter_o)!=&PyList_Type);
31973197
assert(PyStackRef_IsTaggedInt(null_or_index));
31983198
#ifdefPy_GIL_DISABLED
3199-
EXIT_IF(!_Py_IsOwnedByCurrentThread(iter_o)||
3200-
!_PyObject_GC_IS_SHARED(iter_o));
3199+
EXIT_IF(!_Py_IsOwnedByCurrentThread(iter_o)&& !_PyObject_GC_IS_SHARED(iter_o));
32013200
#endif
32023201
}
32033202

‎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
@@ -2902,13 +2902,10 @@ _Py_Specialize_ForIter(_PyStackRef iter, _PyStackRef null_or_index, _Py_CODEUNIT
29022902
PyObject*iter_o=PyStackRef_AsPyObjectBorrow(iter);
29032903
PyTypeObject*tp=Py_TYPE(iter_o);
29042904
#ifdefPy_GIL_DISABLED
2905-
// Only specialize for uniquely referenced iterators, so that we know
2906-
// they're only referenced by this one thread. This is more limiting
2907-
// than we need (even `it = iter(mylist); for item in it:` won't get
2908-
// specialized) but we don't have a way to check whether we're the only
2909-
// _thread_ who has access to the object.
2910-
if (!_PyObject_IsUniquelyReferenced(iter_o))
2905+
// Only specialize for lists owned by this thread or shared
2906+
if (!_Py_IsOwnedByCurrentThread(iter_o)&& !_PyObject_GC_IS_SHARED(iter_o)) {
29112907
gotofailure;
2908+
}
29122909
#endif
29132910
if (PyStackRef_IsNull(null_or_index)) {
29142911
if (tp==&PyRangeIter_Type) {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp