]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-40989: Make _PyTraceMalloc_NewReference() internal (GH-20915)
authorVictor Stinner <vstinner@python.org>
Tue, 16 Jun 2020 15:29:50 +0000 (17:29 +0200)
committerGitHub <noreply@github.com>
Tue, 16 Jun 2020 15:29:50 +0000 (17:29 +0200)
Make the _PyTraceMalloc_NewReference() function fully internal:
remove it from the public C API and don't export it anymore.

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

index 304cfbfc37dff0f92fbe46ca16b6a3ac64686681..ae3920d4508e14d363883556a5bf3c55328afa21 100644 (file)
@@ -9,10 +9,6 @@ PyAPI_FUNC(void) _Py_NewReference(PyObject *op);
 PyAPI_FUNC(void) _Py_ForgetReference(PyObject *);
 #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
 PyAPI_FUNC(Py_ssize_t) _Py_GetRefTotal(void);
 #endif
index 14444a70ceb01a748d37ea7968ea0e901d366567..9740717b8a39755a8d010ec26a8de9953001045c 100644 (file)
@@ -15,6 +15,12 @@ extern "C" {
 PyAPI_FUNC(int) _PyType_CheckConsistency(PyTypeObject *type);
 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()
 static inline int
 _PyType_HasFeature(PyTypeObject *type, unsigned long feature) {