Skip to content

GH-132554: "Virtual" iterators #132555

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 29 commits into from
May 27, 2025
Merged
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
7476442
FOR_ITER now pushes NULL as well as the iterator. Preparation for vir…
markshannon Apr 10, 2025
38a429f
use tagged ints for indexes. Work in progress
markshannon Apr 11, 2025
2caf56f
Remove debug code
markshannon Apr 15, 2025
588943a
Regenerate files
markshannon Apr 15, 2025
aa62e39
Tidy up list of non-escaping functions
markshannon Apr 16, 2025
88562ec
Fix up list iteration for FT build
markshannon Apr 16, 2025
025049d
Fix tier 2 FT build
markshannon Apr 16, 2025
35e389d
Remove debugging code
markshannon Apr 30, 2025
e8f4ce6
Merge branch 'main' into virtual-iterators
markshannon Apr 30, 2025
ed89950
Rename function
markshannon Apr 30, 2025
ec8d797
Restrict specialization in free-threaded build
markshannon Apr 30, 2025
cad1946
Merge branch 'main' into virtual-iterators
markshannon Apr 30, 2025
428735b
Add news
markshannon Apr 30, 2025
4c83848
handle tagged ints when doing type checks
markshannon Apr 30, 2025
f43ccc3
Fix long check
markshannon Apr 30, 2025
3fd46c3
Attempt to make _PyForIter_NextWithIndex thread safe.
markshannon Apr 30, 2025
433282f
Add review comment
markshannon Apr 30, 2025
e915a05
Simplify list indexing code
markshannon May 8, 2025
69a328d
Merge branch 'main' into virtual-iterators
markshannon May 8, 2025
6d1b93e
GET_ITER may leave the iterable on the stack
markshannon May 8, 2025
37ca285
Fix test_dis
markshannon May 8, 2025
f3b9074
Merge branch 'main' into virtual-iterators
markshannon May 19, 2025
0efab59
Merge branch 'main' into virtual-iterators
markshannon May 20, 2025
a0d814b
Merge branch 'main' into virtual-iterators
markshannon May 22, 2025
5cd55c4
Merge branch 'main' into virtual-iterators
markshannon May 22, 2025
867bd10
Merge branch 'main' into virtual-iterators
markshannon May 22, 2025
d9dc597
Clarify assert
markshannon May 27, 2025
d60ef23
Checked for tagged ints
markshannon May 27, 2025
9a9d20d
Address review comments
markshannon May 27, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Checked for tagged ints
  • Loading branch information
markshannon committed May 27, 2025
commit d60ef2341735d50e710e67340f29f17a53b6051e
5 changes: 3 additions & 2 deletions Include/internal/pycore_stackref.h
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ PyStackRef_IsNullOrInt(_PyStackRef ref);
static inline bool
PyStackRef_IsTaggedInt(_PyStackRef i)
{
return (i.bits & Py_INT_TAG) == Py_INT_TAG;
return (i.bits & Py_TAG_BITS) == Py_INT_TAG;
}

static inline _PyStackRef
Expand All @@ -274,6 +274,7 @@ PyStackRef_IncrementTaggedIntNoOverflow(_PyStackRef ref)
return (_PyStackRef){ .bits = ref.bits + 4 };
}

#define PyStackRef_IsDeferredOrTaggedInt(ref) (((ref).bits & Py_TAG_REFCNT) != 0)

#ifdef Py_GIL_DISABLED

Expand Down Expand Up @@ -407,7 +408,7 @@ static inline _PyStackRef
PyStackRef_DUP(_PyStackRef stackref)
{
assert(!PyStackRef_IsNull(stackref));
if (PyStackRef_IsDeferred(stackref)) {
if (PyStackRef_IsDeferredOrTaggedInt(stackref)) {
return stackref;
}
Py_INCREF(PyStackRef_AsPyObjectBorrow(stackref));
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy