[Python-checkins] bpo-40268: Remove unused pycore_pymem.h includes (GH-19531)

Victor Stinner webhook-mailer at python.org
Tue Apr 14 20:57:58 EDT 2020


https://github.com/python/cpython/commit/d9ea5cae1d07e1ee8b03540a9367c26205e0e360
commit: d9ea5cae1d07e1ee8b03540a9367c26205e0e360
branch: master
author: Victor Stinner <vstinner at python.org>
committer: GitHub <noreply at github.com>
date: 2020-04-15T02:57:50+02:00
summary:

bpo-40268: Remove unused pycore_pymem.h includes (GH-19531)

files:
M Modules/_functoolsmodule.c
M Modules/gcmodule.c
M Modules/main.c
M Objects/bytearrayobject.c
M Objects/bytesobject.c
M Objects/cellobject.c
M Objects/classobject.c
M Objects/exceptions.c
M Objects/funcobject.c
M Objects/iterobject.c
M Objects/memoryobject.c
M Objects/methodobject.c
M Objects/obmalloc.c
M Objects/sliceobject.c
M Python/import.c
M Python/initconfig.c
M Python/pathconfig.c
M Python/preconfig.c
M Python/pylifecycle.c
M Python/pystate.c
M Python/sysmodule.c

diff --git a/Modules/_functoolsmodule.c b/Modules/_functoolsmodule.c
index 90e388c1c635c..78706b6ec3c4c 100644
--- a/Modules/_functoolsmodule.c
+++ b/Modules/_functoolsmodule.c
@@ -1,5 +1,4 @@
 #include "Python.h"
-#include "pycore_pymem.h"
 #include "pycore_pystate.h"       // _PyThreadState_GET()
 #include "pycore_tupleobject.h"
 #include "structmember.h"         // PyMemberDef
diff --git a/Modules/gcmodule.c b/Modules/gcmodule.c
index d2cd2c9296616..5727820f09bbb 100644
--- a/Modules/gcmodule.c
+++ b/Modules/gcmodule.c
@@ -30,7 +30,6 @@
 #include "pycore_object.h"
 #include "pycore_pyerrors.h"
 #include "pycore_pystate.h"     // _PyThreadState_GET()
-#include "pycore_pymem.h"
 #include "frameobject.h"        // PyFrame_ClearFreeList
 #include "pydtrace.h"
 #include "pytime.h"             // _PyTime_GetMonotonicClock()
diff --git a/Modules/main.c b/Modules/main.c
index fa9c6b4eb9418..4d696a3590136 100644
--- a/Modules/main.c
+++ b/Modules/main.c
@@ -5,7 +5,6 @@
 #include "pycore_interp.h"       // _PyInterpreterState.sysdict
 #include "pycore_pathconfig.h"
 #include "pycore_pylifecycle.h"
-#include "pycore_pymem.h"
 #include "pycore_pystate.h"      // _PyInterpreterState_GET()
 
 /* Includes for exit_sigint() */
diff --git a/Objects/bytearrayobject.c b/Objects/bytearrayobject.c
index f05a98acba043..b271e57abb686 100644
--- a/Objects/bytearrayobject.c
+++ b/Objects/bytearrayobject.c
@@ -5,7 +5,6 @@
 #include "pycore_abstract.h"      // _PyIndex_Check()
 #include "pycore_bytes_methods.h"
 #include "pycore_object.h"
-#include "pycore_pymem.h"
 #include "bytesobject.h"
 #include "pystrhex.h"
 
diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c
index 30bc739ceea7f..06ead2b58f980 100644
--- a/Objects/bytesobject.c
+++ b/Objects/bytesobject.c
@@ -3,10 +3,10 @@
 #define PY_SSIZE_T_CLEAN
 
 #include "Python.h"
-#include "pycore_abstract.h"   // _PyIndex_Check()
+#include "pycore_abstract.h"      // _PyIndex_Check()
 #include "pycore_bytes_methods.h"
 #include "pycore_object.h"
-#include "pycore_pymem.h"
+#include "pycore_pymem.h"         // PYMEM_CLEANBYTE
 
 #include "pystrhex.h"
 #include <stddef.h>
diff --git a/Objects/cellobject.c b/Objects/cellobject.c
index 6efae626bf5b7..86a89f02e60d3 100644
--- a/Objects/cellobject.c
+++ b/Objects/cellobject.c
@@ -2,7 +2,6 @@
 
 #include "Python.h"
 #include "pycore_object.h"
-#include "pycore_pymem.h"
 
 PyObject *
 PyCell_New(PyObject *obj)
diff --git a/Objects/classobject.c b/Objects/classobject.c
index 242a6428b8ef2..fd9f8757f84ab 100644
--- a/Objects/classobject.c
+++ b/Objects/classobject.c
@@ -3,7 +3,6 @@
 #include "Python.h"
 #include "pycore_object.h"
 #include "pycore_pyerrors.h"
-#include "pycore_pymem.h"
 #include "pycore_pystate.h"       // _PyThreadState_GET()
 #include "structmember.h"         // PyMemberDef
 
diff --git a/Objects/exceptions.c b/Objects/exceptions.c
index db1ff329ac143..69a6b5c284dfa 100644
--- a/Objects/exceptions.c
+++ b/Objects/exceptions.c
@@ -8,7 +8,6 @@
 #include <Python.h>
 #include "pycore_initconfig.h"
 #include "pycore_object.h"
-#include "pycore_pymem.h"
 #include "structmember.h"         // PyMemberDef
 #include "osdefs.h"
 
diff --git a/Objects/funcobject.c b/Objects/funcobject.c
index 750c7aea0dfd6..bd24f67b9740a 100644
--- a/Objects/funcobject.c
+++ b/Objects/funcobject.c
@@ -3,7 +3,6 @@
 
 #include "Python.h"
 #include "pycore_object.h"
-#include "pycore_pymem.h"
 #include "pycore_tupleobject.h"
 #include "code.h"
 #include "structmember.h"         // PyMemberDef
diff --git a/Objects/iterobject.c b/Objects/iterobject.c
index 51104fbe9695f..6cac41ad539db 100644
--- a/Objects/iterobject.c
+++ b/Objects/iterobject.c
@@ -2,7 +2,6 @@
 
 #include "Python.h"
 #include "pycore_object.h"
-#include "pycore_pymem.h"
 
 typedef struct {
     PyObject_HEAD
diff --git a/Objects/memoryobject.c b/Objects/memoryobject.c
index 4340f0675f163..682bbe8a61e85 100644
--- a/Objects/memoryobject.c
+++ b/Objects/memoryobject.c
@@ -13,7 +13,6 @@
 #include "Python.h"
 #include "pycore_abstract.h"   // _PyIndex_Check()
 #include "pycore_object.h"
-#include "pycore_pymem.h"
 #include "pystrhex.h"
 #include <stddef.h>
 
diff --git a/Objects/methodobject.c b/Objects/methodobject.c
index f483671316225..20eba6fa8643b 100644
--- a/Objects/methodobject.c
+++ b/Objects/methodobject.c
@@ -5,7 +5,6 @@
 #include "pycore_ceval.h"         // _Py_EnterRecursiveCall()
 #include "pycore_object.h"
 #include "pycore_pyerrors.h"
-#include "pycore_pymem.h"
 #include "pycore_pystate.h"       // _PyThreadState_GET()
 #include "structmember.h"         // PyMemberDef
 
diff --git a/Objects/obmalloc.c b/Objects/obmalloc.c
index 3f6f9cf9ca4a4..eb34f10bddf99 100644
--- a/Objects/obmalloc.c
+++ b/Objects/obmalloc.c
@@ -1,5 +1,5 @@
 #include "Python.h"
-#include "pycore_pymem.h"
+#include "pycore_pymem.h"         // _PyTraceMalloc_Config
 
 #include <stdbool.h>
 
diff --git a/Objects/sliceobject.c b/Objects/sliceobject.c
index 6093b3bd1534d..391711f711aae 100644
--- a/Objects/sliceobject.c
+++ b/Objects/sliceobject.c
@@ -16,7 +16,6 @@ this type and there is exactly one in existence.
 #include "Python.h"
 #include "pycore_abstract.h"      // _PyIndex_Check()
 #include "pycore_object.h"
-#include "pycore_pymem.h"
 #include "structmember.h"         // PyMemberDef
 
 static PyObject *
diff --git a/Python/import.c b/Python/import.c
index 2f2e9d17061bf..a2aa4afa18a72 100644
--- a/Python/import.c
+++ b/Python/import.c
@@ -8,7 +8,7 @@
 #include "pycore_pyerrors.h"
 #include "pycore_pyhash.h"
 #include "pycore_pylifecycle.h"
-#include "pycore_pymem.h"
+#include "pycore_pymem.h"         // _PyMem_SetDefaultAllocator()
 #include "pycore_interp.h"        // _PyInterpreterState_ClearModules()
 #include "pycore_pystate.h"       // _PyInterpreterState_GET()
 #include "pycore_sysmodule.h"
diff --git a/Python/initconfig.c b/Python/initconfig.c
index 201d930f7d8d2..32aafdb57addf 100644
--- a/Python/initconfig.c
+++ b/Python/initconfig.c
@@ -7,7 +7,7 @@
 #include "pycore_pathconfig.h"
 #include "pycore_pyerrors.h"
 #include "pycore_pylifecycle.h"
-#include "pycore_pymem.h"
+#include "pycore_pymem.h"         // _PyMem_SetDefaultAllocator()
 #include "pycore_pystate.h"       // _PyThreadState_GET()
 #include <locale.h>               // setlocale()
 #ifdef HAVE_LANGINFO_H
diff --git a/Python/pathconfig.c b/Python/pathconfig.c
index 1515926531a1c..6ebfdac3fd2d3 100644
--- a/Python/pathconfig.c
+++ b/Python/pathconfig.c
@@ -5,7 +5,7 @@
 #include "pycore_initconfig.h"
 #include "pycore_fileutils.h"
 #include "pycore_pathconfig.h"
-#include "pycore_pymem.h"
+#include "pycore_pymem.h"         // _PyMem_SetDefaultAllocator()
 #include <wchar.h>
 #ifdef MS_WINDOWS
 #  include <windows.h>            // GetFullPathNameW(), MAX_PATH
diff --git a/Python/preconfig.c b/Python/preconfig.c
index 531d8d0df3504..1cbfccfe69ce1 100644
--- a/Python/preconfig.c
+++ b/Python/preconfig.c
@@ -1,9 +1,9 @@
 #include "Python.h"
 #include "pycore_getopt.h"
 #include "pycore_initconfig.h"
-#include "pycore_pymem.h"      // _PyMem_GetAllocatorName()
-#include "pycore_runtime.h"    // _PyRuntime_Initialize()
-#include <locale.h>            // setlocale()
+#include "pycore_pymem.h"         // _PyMem_GetAllocatorName()
+#include "pycore_runtime.h"       // _PyRuntime_Initialize()
+#include <locale.h>               // setlocale()
 
 
 #define DECODE_LOCALE_ERR(NAME, LEN) \
diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c
index 974b425712cc8..9c13274dac04d 100644
--- a/Python/pylifecycle.c
+++ b/Python/pylifecycle.c
@@ -14,7 +14,6 @@
 #include "pycore_pathconfig.h"
 #include "pycore_pyerrors.h"
 #include "pycore_pylifecycle.h"
-#include "pycore_pymem.h"
 #include "pycore_pystate.h"       // _PyThreadState_GET()
 #include "pycore_sysmodule.h"
 #include "pycore_traceback.h"
diff --git a/Python/pystate.c b/Python/pystate.c
index d25fb3a2a626e..84a694b32e5d0 100644
--- a/Python/pystate.c
+++ b/Python/pystate.c
@@ -6,7 +6,7 @@
 #include "pycore_initconfig.h"
 #include "pycore_pyerrors.h"
 #include "pycore_pylifecycle.h"
-#include "pycore_pymem.h"
+#include "pycore_pymem.h"         // _PyMem_SetDefaultAllocator()
 #include "pycore_pystate.h"       // _PyThreadState_GET()
 #include "pycore_sysmodule.h"
 
diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index 63111d58ab2e1..4e67325318aaf 100644
--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -17,14 +17,14 @@ Data members:
 #include "Python.h"
 #include "code.h"
 #include "frameobject.h"
-#include "pycore_ceval.h"        // _Py_RecursionLimitLowerWaterMark()
+#include "pycore_ceval.h"         // _Py_RecursionLimitLowerWaterMark()
 #include "pycore_initconfig.h"
 #include "pycore_object.h"
 #include "pycore_pathconfig.h"
 #include "pycore_pyerrors.h"
 #include "pycore_pylifecycle.h"
-#include "pycore_pymem.h"
-#include "pycore_pystate.h"      // _PyThreadState_GET()
+#include "pycore_pymem.h"         // _PyMem_SetDefaultAllocator()
+#include "pycore_pystate.h"       // _PyThreadState_GET()
 #include "pycore_tupleobject.h"
 #include "pydtrace.h"
 



More information about the Python-checkins mailing list