[Python-checkins] gh-106320: Remove _PyTuple_MaybeUntrack() C API (#107143)

vstinner webhook-mailer at python.org
Sun Jul 23 15:16:25 EDT 2023


https://github.com/python/cpython/commit/0810b0c435415c09c1907c6f418585bed558a2c1
commit: 0810b0c435415c09c1907c6f418585bed558a2c1
branch: main
author: Victor Stinner <vstinner at python.org>
committer: vstinner <vstinner at python.org>
date: 2023-07-23T19:16:21Z
summary:

gh-106320: Remove _PyTuple_MaybeUntrack() C API (#107143)

Move _PyTuple_MaybeUntrack() and _PyTuple_DebugMallocStats() functions
to the internal C API (pycore_tuple.h). No longer export these functions.

files:
M Include/cpython/tupleobject.h
M Include/internal/pycore_tuple.h

diff --git a/Include/cpython/tupleobject.h b/Include/cpython/tupleobject.h
index 370da1612a61e..e530c8beda44a 100644
--- a/Include/cpython/tupleobject.h
+++ b/Include/cpython/tupleobject.h
@@ -11,7 +11,6 @@ typedef struct {
 } PyTupleObject;
 
 PyAPI_FUNC(int) _PyTuple_Resize(PyObject **, Py_ssize_t);
-PyAPI_FUNC(void) _PyTuple_MaybeUntrack(PyObject *);
 
 /* Cast argument to PyTupleObject* type. */
 #define _PyTuple_CAST(op) \
@@ -37,5 +36,3 @@ PyTuple_SET_ITEM(PyObject *op, Py_ssize_t index, PyObject *value) {
 }
 #define PyTuple_SET_ITEM(op, index, value) \
     PyTuple_SET_ITEM(_PyObject_CAST(op), (index), _PyObject_CAST(value))
-
-PyAPI_FUNC(void) _PyTuple_DebugMallocStats(FILE *out);
diff --git a/Include/internal/pycore_tuple.h b/Include/internal/pycore_tuple.h
index 335edad89792c..4fa7a12206bcb 100644
--- a/Include/internal/pycore_tuple.h
+++ b/Include/internal/pycore_tuple.h
@@ -8,8 +8,8 @@ extern "C" {
 #  error "this header requires Py_BUILD_CORE define"
 #endif
 
-#include "tupleobject.h"   /* _PyTuple_CAST() */
-
+extern void _PyTuple_MaybeUntrack(PyObject *);
+extern void _PyTuple_DebugMallocStats(FILE *out);
 
 /* runtime lifecycle */
 



More information about the Python-checkins mailing list