]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-106320: Remove private _PyManagedBuffer_Type (#108431)
authorVictor Stinner <vstinner@python.org>
Thu, 24 Aug 2023 17:07:54 +0000 (19:07 +0200)
committerGitHub <noreply@github.com>
Thu, 24 Aug 2023 17:07:54 +0000 (19:07 +0200)
Remove private _PyManagedBuffer_Type variable. Move it to the
internal C API and no longer export it.

Include/cpython/memoryobject.h
Include/internal/pycore_memoryobject.h
Objects/memoryobject.c
Objects/object.c

index 3837fa8c6ab5aac4526e3f15ef38ca24b8385353..961161b70f20580b9d1c1408b3b58aebf01214ec 100644 (file)
@@ -2,8 +2,6 @@
 #  error "this header file must not be included directly"
 #endif
 
-PyAPI_DATA(PyTypeObject) _PyManagedBuffer_Type;
-
 /* The structs are declared here so that macros can work, but they shouldn't
    be considered public. Don't access their fields directly, use the macros
    and functions instead! */
index fe19e3f9611a1675933b1ea5ceeb1ec9e55d1612..62e204fcbf65339d252793e0ffd1e54b9f860ce3 100644 (file)
@@ -8,6 +8,8 @@ extern "C" {
 #  error "this header requires Py_BUILD_CORE define"
 #endif
 
+extern PyTypeObject _PyManagedBuffer_Type;
+
 PyObject *
 _PyMemoryView_FromBufferProc(PyObject *v, int flags,
                              getbufferproc bufferproc);
index b0168044d9f85a707b79f2f329f43b3e23574cc8..bcdd2ff0ceafe64e30ef52d4f349d02704919e97 100644 (file)
@@ -12,6 +12,7 @@
 
 #include "Python.h"
 #include "pycore_abstract.h"      // _PyIndex_Check()
+#include "pycore_memoryobject.h"  // _PyManagedBuffer_Type
 #include "pycore_object.h"        // _PyObject_GC_UNTRACK()
 #include "pycore_strhex.h"        // _Py_strhex_with_sep()
 #include <stddef.h>               // offsetof()
index 868623a9f7bffc2acabc444ac2d361c09ce5da16..02e2611020983d17ac745bfdbc83e8a5596b382d 100644 (file)
@@ -9,15 +9,17 @@
 #include "pycore_dict.h"          // _PyObject_MakeDictFromInstanceAttributes()
 #include "pycore_floatobject.h"   // _PyFloat_DebugMallocStats()
 #include "pycore_initconfig.h"    // _PyStatus_EXCEPTION()
+#include "pycore_memoryobject.h"  // _PyManagedBuffer_Type
 #include "pycore_namespace.h"     // _PyNamespace_Type
 #include "pycore_object.h"        // PyAPI_DATA() _Py_SwappedOp definition
 #include "pycore_pyerrors.h"      // _PyErr_Occurred()
 #include "pycore_pymem.h"         // _PyMem_IsPtrFreed()
 #include "pycore_pystate.h"       // _PyThreadState_GET()
 #include "pycore_symtable.h"      // PySTEntry_Type
-#include "pycore_typevarobject.h" // _PyTypeAlias_Type, _Py_initialize_generic
 #include "pycore_typeobject.h"    // _PyBufferWrapper_Type
+#include "pycore_typevarobject.h" // _PyTypeAlias_Type, _Py_initialize_generic
 #include "pycore_unionobject.h"   // _PyUnion_Type
+
 #include "interpreteridobject.h"  // _PyInterpreterID_Type
 
 #ifdef Py_LIMITED_API