summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorSam Gross <colesbury@gmail.com>2023-11-10 23:54:35 (GMT)
committerGitHub <noreply@github.com>2023-11-10 23:54:35 (GMT)
commitfa84e5fe0a3bd8e77c33b20867d71ac6bee270f9 (patch)
tree65031b57b411c2e75fe859ec9107f4e021353030 /Objects
parentae8116cfa944dccad13638f6875b33b98d285b63 (diff)
downloadcpython-fa84e5fe0a3bd8e77c33b20867d71ac6bee270f9.zip
cpython-fa84e5fe0a3bd8e77c33b20867d71ac6bee270f9.tar.gz
cpython-fa84e5fe0a3bd8e77c33b20867d71ac6bee270f9.tar.bz2
gh-110481: fix 'unused function' warning for `is_shared_refcnt_dead`. (gh-111974)
Fix 'unused function' warning for `is_shared_refcnt_dead`. The `is_shared_refcnt_dead` function is only used if `Py_REF_DEBUG` is set.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/object.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/Objects/object.c b/Objects/object.c
index b766278..1003029 100644
--- a/Objects/object.c
+++ b/Objects/object.c
@@ -297,15 +297,17 @@ _Py_DecRef(PyObject *o)
}
#ifdef Py_NOGIL
+# ifdef Py_REF_DEBUG
static inline int
is_shared_refcnt_dead(Py_ssize_t shared)
{
-#if SIZEOF_SIZE_T == 8
+# if SIZEOF_SIZE_T == 8
return shared == (Py_ssize_t)0xDDDDDDDDDDDDDDDD;
-#else
+# else
return shared == (Py_ssize_t)0xDDDDDDDD;
-#endif
+# endif
}
+# endif
void
_Py_DecRefSharedDebug(PyObject *o, const char *filename, int lineno)
@@ -412,7 +414,7 @@ _Py_ExplicitMergeRefcount(PyObject *op, Py_ssize_t extra)
_Py_atomic_store_uintptr_relaxed(&op->ob_tid, 0);
return refcnt;
}
-#endif
+#endif /* Py_NOGIL */
/**************************************/