Skip to content

Commit fcc60e4

Browse files
authored
bpo-40989: Make _PyTraceMalloc_NewReference() internal (GH-20915)
Make the _PyTraceMalloc_NewReference() function fully internal: remove it from the public C API and don't export it anymore.
1 parent fc710ee commit fcc60e4

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

Include/cpython/object.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@ PyAPI_FUNC(void) _Py_NewReference(PyObject *op);
99
PyAPI_FUNC(void) _Py_ForgetReference(PyObject *);
1010
#endif
1111

12-
/* Update the Python traceback of an object. This function must be called
13-
when a memory block is reused from a free list. */
14-
PyAPI_FUNC(int) _PyTraceMalloc_NewReference(PyObject *op);
15-
1612
#ifdef Py_REF_DEBUG
1713
PyAPI_FUNC(Py_ssize_t) _Py_GetRefTotal(void);
1814
#endif

Include/internal/pycore_object.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ extern "C" {
1515
PyAPI_FUNC(int) _PyType_CheckConsistency(PyTypeObject *type);
1616
PyAPI_FUNC(int) _PyDict_CheckConsistency(PyObject *mp, int check_content);
1717

18+
/* Update the Python traceback of an object. This function must be called
19+
when a memory block is reused from a free list.
20+
21+
Internal function called by _Py_NewReference(). */
22+
extern int _PyTraceMalloc_NewReference(PyObject *op);
23+
1824
// Fast inlined version of PyType_HasFeature()
1925
static inline int
2026
_PyType_HasFeature(PyTypeObject *type, unsigned long feature) {

0 commit comments

Comments
 (0)