summaryrefslogtreecommitdiffstats
path: root/PCbuild
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2021-04-21 22:52:52 (GMT)
committerGitHub <noreply@github.com>2021-04-21 22:52:52 (GMT)
commitcdad2724e6f7426372901cc5dedd8a462ba046a6 (patch)
treeca6a34bfdc6c05ea86d2ff2686ebd116750b2305 /PCbuild
parenta32f8fe7133aad4f3cf8946534e3b79a5f2659da (diff)
downloadcpython-cdad2724e6f7426372901cc5dedd8a462ba046a6.zip
cpython-cdad2724e6f7426372901cc5dedd8a462ba046a6.tar.gz
cpython-cdad2724e6f7426372901cc5dedd8a462ba046a6.tar.bz2
bpo-40137: Add pycore_moduleobject.h internal header (GH-25507)
Add pycore_moduleobject.h internal header file with static inline functions to access module members: * _PyModule_GetDict() * _PyModule_GetDef() * _PyModule_GetState() These functions don't check at runtime if their argument has a valid type and can be inlined even if Python is not built with LTO. _PyType_GetModuleByDef() uses _PyModule_GetDef(). Replace PyModule_GetState() with _PyModule_GetState() in the extension modules, considered as performance sensitive: * _abc * _functools * _operator * _pickle * _queue * _random * _sre * _struct * _thread * _winapi * array * posix The following extensions are now built with the Py_BUILD_CORE_MODULE macro defined, to be able to use the internal pycore_moduleobject.h header: _abc, array, _operator, _queue, _sre, _struct.
Diffstat (limited to 'PCbuild')
-rw-r--r--PCbuild/pythoncore.vcxproj1
-rw-r--r--PCbuild/pythoncore.vcxproj.filters3
2 files changed, 4 insertions, 0 deletions
diff --git a/PCbuild/pythoncore.vcxproj b/PCbuild/pythoncore.vcxproj
index 3c4785c..429d437 100644
--- a/PCbuild/pythoncore.vcxproj
+++ b/PCbuild/pythoncore.vcxproj
@@ -199,6 +199,7 @@
<ClInclude Include="..\Include\internal\pycore_interp.h" />
<ClInclude Include="..\Include\internal\pycore_list.h" />
<ClInclude Include="..\Include\internal\pycore_long.h" />
+ <ClInclude Include="..\Include\internal\pycore_moduleobject.h" />
<ClInclude Include="..\Include\internal\pycore_object.h" />
<ClInclude Include="..\Include\internal\pycore_pathconfig.h" />
<ClInclude Include="..\Include\internal\pycore_pyarena.h" />
diff --git a/PCbuild/pythoncore.vcxproj.filters b/PCbuild/pythoncore.vcxproj.filters
index 8c104bf..55b57ef 100644
--- a/PCbuild/pythoncore.vcxproj.filters
+++ b/PCbuild/pythoncore.vcxproj.filters
@@ -558,6 +558,9 @@
<ClInclude Include="..\Include\internal\pycore_long.h">
<Filter>Include\internal</Filter>
</ClInclude>
+ <ClInclude Include="..\Include\internal\pycore_moduleobject.h">
+ <Filter>Include\internal</Filter>
+ </ClInclude>
<ClInclude Include="..\Include\internal\pycore_object.h">
<Filter>Include\internal</Filter>
</ClInclude>