Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32k
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Changes fromall commits
7476442
38a429f
2caf56f
588943a
aa62e39
88562ec
025049d
35e389d
e8f4ce6
ed89950
ec8d797
cad1946
428735b
4c83848
f43ccc3
3fd46c3
433282f
e915a05
69a328d
6d1b93e
37ca285
f3b9074
0efab59
a0d814b
5cd55c4
867bd10
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -232,6 +232,9 @@ extern intptr_t PyStackRef_UntagInt(_PyStackRef ref); | ||
extern _PyStackRef PyStackRef_TagInt(intptr_t i); | ||
/* Increments a tagged int, but does not check for overflow */ | ||
extern _PyStackRef PyStackRef_IncrementTaggedIntNoOverflow(_PyStackRef ref); | ||
markshannon marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
extern bool | ||
PyStackRef_IsNullOrInt(_PyStackRef ref); | ||
@@ -262,6 +265,14 @@ PyStackRef_UntagInt(_PyStackRef i) | ||
} | ||
static inline _PyStackRef | ||
PyStackRef_IncrementTaggedIntNoOverflow(_PyStackRef ref) | ||
{ | ||
assert(ref.bits != (uintptr_t)-1); // Deosn't overflow | ||
return (_PyStackRef){ .bits = ref.bits + 4 }; | ||
} | ||
#ifdef Py_GIL_DISABLED | ||
#define Py_TAG_DEFERRED Py_TAG_REFCNT | ||
@@ -678,7 +689,13 @@ PyStackRef_XCLOSE(_PyStackRef ref) | ||
#endif // !defined(Py_GIL_DISABLED) && defined(Py_STACKREF_DEBUG) | ||
static inline PyTypeObject * | ||
PyStackRef_TYPE(_PyStackRef stackref) { | ||
if (PyStackRef_IsTaggedInt(stackref)) { | ||
return &PyLong_Type; | ||
} | ||
return Py_TYPE(PyStackRef_AsPyObjectBorrow(stackref)); | ||
} | ||
// Converts a PyStackRef back to a PyObject *, converting the | ||
// stackref to a new reference. | ||
@@ -689,36 +706,54 @@ PyStackRef_XCLOSE(_PyStackRef ref) | ||
static inline bool | ||
PyStackRef_GenCheck(_PyStackRef stackref) | ||
{ | ||
if (PyStackRef_IsTaggedInt(stackref)) { | ||
return false; | ||
} | ||
return PyGen_Check(PyStackRef_AsPyObjectBorrow(stackref)); | ||
} | ||
static inline bool | ||
PyStackRef_BoolCheck(_PyStackRef stackref) | ||
{ | ||
if (PyStackRef_IsTaggedInt(stackref)) { | ||
return false; | ||
} | ||
return PyBool_Check(PyStackRef_AsPyObjectBorrow(stackref)); | ||
} | ||
static inline bool | ||
PyStackRef_LongCheck(_PyStackRef stackref) | ||
{ | ||
if (PyStackRef_IsTaggedInt(stackref)) { | ||
return true; | ||
} | ||
return PyLong_Check(PyStackRef_AsPyObjectBorrow(stackref)); | ||
} | ||
static inline bool | ||
PyStackRef_ExceptionInstanceCheck(_PyStackRef stackref) | ||
{ | ||
if (PyStackRef_IsTaggedInt(stackref)) { | ||
return false; | ||
} | ||
return PyExceptionInstance_Check(PyStackRef_AsPyObjectBorrow(stackref)); | ||
} | ||
static inline bool | ||
PyStackRef_CodeCheck(_PyStackRef stackref) | ||
{ | ||
if (PyStackRef_IsTaggedInt(stackref)) { | ||
return false; | ||
} | ||
return PyCode_Check(PyStackRef_AsPyObjectBorrow(stackref)); | ||
} | ||
static inline bool | ||
PyStackRef_FunctionCheck(_PyStackRef stackref) | ||
{ | ||
if (PyStackRef_IsTaggedInt(stackref)) { | ||
return false; | ||
} | ||
return PyFunction_Check(PyStackRef_AsPyObjectBorrow(stackref)); | ||
} | ||
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.