Skip to content

Commit 24b9bdd

Browse files
authored
gh-106320: Remove private _Py_ForgetReference() (#108664)
Move the private _Py_ForgetReference() function to the internal C API (pycore_object.h).
1 parent 14ec0bb commit 24b9bdd

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Include/cpython/object.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,6 @@
55
PyAPI_FUNC(void) _Py_NewReference(PyObject *op);
66
PyAPI_FUNC(void) _Py_NewReferenceNoTotal(PyObject *op);
77

8-
#ifdef Py_TRACE_REFS
9-
/* Py_TRACE_REFS is such major surgery that we call external routines. */
10-
PyAPI_FUNC(void) _Py_ForgetReference(PyObject *);
11-
#endif
12-
138
#ifdef Py_REF_DEBUG
149
/* These are useful as debugging aids when chasing down refleaks. */
1510
PyAPI_FUNC(Py_ssize_t) _Py_GetGlobalRefTotal(void);

Include/internal/pycore_object.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ extern void _PyDebugAllocatorStats(FILE *out, const char *block_name,
3131

3232
extern void _PyObject_DebugTypeStats(FILE *out);
3333

34+
#ifdef Py_TRACE_REFS
35+
/* Py_TRACE_REFS is such major surgery that we call external routines. */
36+
PyAPI_FUNC(void) _Py_ForgetReference(PyObject *);
37+
#endif
38+
3439
// Export for shared _testinternalcapi extension
3540
PyAPI_FUNC(int) _PyObject_IsFreed(PyObject *);
3641

0 commit comments

Comments
 (0)