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.
This commit is contained in:
Victor Stinner 2020-06-16 17:29:50 +02:00 committed by GitHub
parent fc710ee266
commit fcc60e40bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 4 deletions

View File

@ -9,10 +9,6 @@ PyAPI_FUNC(void) _Py_NewReference(PyObject *op);
PyAPI_FUNC(void) _Py_ForgetReference(PyObject *); PyAPI_FUNC(void) _Py_ForgetReference(PyObject *);
#endif #endif
/* Update the Python traceback of an object. This function must be called
when a memory block is reused from a free list. */
PyAPI_FUNC(int) _PyTraceMalloc_NewReference(PyObject *op);
#ifdef Py_REF_DEBUG #ifdef Py_REF_DEBUG
PyAPI_FUNC(Py_ssize_t) _Py_GetRefTotal(void); PyAPI_FUNC(Py_ssize_t) _Py_GetRefTotal(void);
#endif #endif

View File

@ -15,6 +15,12 @@ extern "C" {
PyAPI_FUNC(int) _PyType_CheckConsistency(PyTypeObject *type); PyAPI_FUNC(int) _PyType_CheckConsistency(PyTypeObject *type);
PyAPI_FUNC(int) _PyDict_CheckConsistency(PyObject *mp, int check_content); PyAPI_FUNC(int) _PyDict_CheckConsistency(PyObject *mp, int check_content);
/* Update the Python traceback of an object. This function must be called
when a memory block is reused from a free list.
Internal function called by _Py_NewReference(). */
extern int _PyTraceMalloc_NewReference(PyObject *op);
// Fast inlined version of PyType_HasFeature() // Fast inlined version of PyType_HasFeature()
static inline int static inline int
_PyType_HasFeature(PyTypeObject *type, unsigned long feature) { _PyType_HasFeature(PyTypeObject *type, unsigned long feature) {