We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 49d0d42 commit 3a12d18Copy full SHA for 3a12d18
Include/internal/pycore_stackref.h
@@ -267,12 +267,20 @@ PyStackRef_HasCount(_PyStackRef ref)
267
return ref.bits & Py_TAG_REFCNT;
268
}
269
270
+/* Does this ref have an embedded refcount and refer to a mortal object (NULL is not mortal) */
271
static inline bool
272
PyStackRef_HasCountAndMortal(_PyStackRef ref)
273
{
274
return (ref.bits & Py_TAG_BITS) == Py_TAG_REFCNT;
275
276
277
+/* Does this ref refer to a mortal object (NULL is not mortal) */
278
+static inline bool
279
+PyStackRef_IsMortal(_PyStackRef ref)
280
+{
281
+ return (ref.bits & Py_TAG_BITS) != Py_TAG_IMMORTAL;
282
+}
283
+
284
static inline PyObject *
285
PyStackRef_AsPyObjectBorrow(_PyStackRef ref)
286
0 commit comments