From 36a896e8f163c9f5d646cfa640f3907ef25f03e4 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Wed, 30 Aug 2023 04:49:48 +0200 Subject: [PATCH] gh-106320: Remove private _Py_ForgetReference() Move the private _Py_ForgetReference() function to the internal C API (pycore_object.h). --- Include/cpython/object.h | 5 ----- Include/internal/pycore_object.h | 5 +++++ 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Include/cpython/object.h b/Include/cpython/object.h index 489b2eecd32991..e5987191cfe08c 100644 --- a/Include/cpython/object.h +++ b/Include/cpython/object.h @@ -5,11 +5,6 @@ PyAPI_FUNC(void) _Py_NewReference(PyObject *op); PyAPI_FUNC(void) _Py_NewReferenceNoTotal(PyObject *op); -#ifdef Py_TRACE_REFS -/* Py_TRACE_REFS is such major surgery that we call external routines. */ -PyAPI_FUNC(void) _Py_ForgetReference(PyObject *); -#endif - #ifdef Py_REF_DEBUG /* These are useful as debugging aids when chasing down refleaks. */ PyAPI_FUNC(Py_ssize_t) _Py_GetGlobalRefTotal(void); diff --git a/Include/internal/pycore_object.h b/Include/internal/pycore_object.h index 32ff2794e36231..7cb822e6af9750 100644 --- a/Include/internal/pycore_object.h +++ b/Include/internal/pycore_object.h @@ -31,6 +31,11 @@ extern void _PyDebugAllocatorStats(FILE *out, const char *block_name, extern void _PyObject_DebugTypeStats(FILE *out); +#ifdef Py_TRACE_REFS +/* Py_TRACE_REFS is such major surgery that we call external routines. */ +PyAPI_FUNC(void) _Py_ForgetReference(PyObject *); +#endif + // Export for shared _testinternalcapi extension PyAPI_FUNC(int) _PyObject_IsFreed(PyObject *);