summaryrefslogtreecommitdiffstats
path: root/Include/internal
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2022-04-28 12:02:45 (GMT)
committerGitHub <noreply@github.com>2022-04-28 12:02:45 (GMT)
commit87c6cf9aa7cebac3c544067e690c2ad7ce18b772 (patch)
tree6b3949ea9c241af6ef9627556727b3438cb97c59 /Include/internal
parent88dd22795925a8f47d38737ca8067eeb3f0a13aa (diff)
downloadcpython-87c6cf9aa7cebac3c544067e690c2ad7ce18b772.zip
cpython-87c6cf9aa7cebac3c544067e690c2ad7ce18b772.tar.gz
cpython-87c6cf9aa7cebac3c544067e690c2ad7ce18b772.tar.bz2
gh-89479: Export _Py_GetSpecializationStats() internal function (#92011)
When Python is built with "./configure --enable-pystats" (if the Py_STATS macro is defined), the _Py_GetSpecializationStats() function must be exported, since it's used by the _opcode extension which is built as a shared library.
Diffstat (limited to 'Include/internal')
-rw-r--r--Include/internal/pycore_code.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/Include/internal/pycore_code.h b/Include/internal/pycore_code.h
index 3059db4..8a599c4 100644
--- a/Include/internal/pycore_code.h
+++ b/Include/internal/pycore_code.h
@@ -316,7 +316,8 @@ extern PyStats _py_stats;
extern void _Py_PrintSpecializationStats(int to_file);
-extern PyObject* _Py_GetSpecializationStats(void);
+// Used by the _opcode extension which is built as a shared library
+PyAPI_FUNC(PyObject*) _Py_GetSpecializationStats(void);
#else
#define STAT_INC(opname, name) ((void)0)
@@ -324,7 +325,7 @@ extern PyObject* _Py_GetSpecializationStats(void);
#define OPCODE_EXE_INC(opname) ((void)0)
#define CALL_STAT_INC(name) ((void)0)
#define OBJECT_STAT_INC(name) ((void)0)
-#endif
+#endif // !Py_STATS
// Cache values are only valid in memory, so use native endianness.
#ifdef WORDS_BIGENDIAN