Skip to content

Commit fa84e5f

Browse files
authored
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.
1 parent ae8116c commit fa84e5f

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Objects/object.c

+6-4
Original file line numberDiff line numberDiff line change
@@ -297,15 +297,17 @@ _Py_DecRef(PyObject *o)
297297
}
298298

299299
#ifdef Py_NOGIL
300+
# ifdef Py_REF_DEBUG
300301
static inline int
301302
is_shared_refcnt_dead(Py_ssize_t shared)
302303
{
303-
#if SIZEOF_SIZE_T == 8
304+
# if SIZEOF_SIZE_T == 8
304305
return shared == (Py_ssize_t)0xDDDDDDDDDDDDDDDD;
305-
#else
306+
# else
306307
return shared == (Py_ssize_t)0xDDDDDDDD;
307-
#endif
308+
# endif
308309
}
310+
# endif
309311

310312
void
311313
_Py_DecRefSharedDebug(PyObject *o, const char *filename, int lineno)
@@ -412,7 +414,7 @@ _Py_ExplicitMergeRefcount(PyObject *op, Py_ssize_t extra)
412414
_Py_atomic_store_uintptr_relaxed(&op->ob_tid, 0);
413415
return refcnt;
414416
}
415-
#endif
417+
#endif /* Py_NOGIL */
416418

417419

418420
/**************************************/

0 commit comments

Comments
 (0)