Skip to content

Commit

Permalink
gh-110481: fix 'unused function' warning for is_shared_refcnt_dead. (
Browse files Browse the repository at this point in the history
…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.
  • Loading branch information
colesbury committed Nov 10, 2023
1 parent ae8116c commit fa84e5f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Objects/object.c
Expand Up @@ -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)
Expand Down Expand Up @@ -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 */


/**************************************/
Expand Down

0 comments on commit fa84e5f

Please sign in to comment.