]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-106320: Remove private _Py_ForgetReference() (#108664)
authorVictor Stinner <vstinner@python.org>
Wed, 30 Aug 2023 03:34:43 +0000 (05:34 +0200)
committerGitHub <noreply@github.com>
Wed, 30 Aug 2023 03:34:43 +0000 (03:34 +0000)
Move the private _Py_ForgetReference() function to the internal C API
(pycore_object.h).

Include/cpython/object.h
Include/internal/pycore_object.h

index 489b2eecd329917891c0647a79a710f5c10d86b9..e5987191cfe08c4fe40bc0cd03792fb31676d3d3 100644 (file)
@@ -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);
index 32ff2794e3623141e00e4840ad4be8d41a5a2c4e..7cb822e6af975053864b9686c53dceb42a5d50e3 100644 (file)
@@ -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 *);