Skip to content

Commit 87c6cf9

Browse files
authored
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.
1 parent 88dd227 commit 87c6cf9

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

Doc/using/configure.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ General Options
139139
The statistics will be dumped to a arbitrary (probably unique) file in
140140
``/tmp/py_stats/``, or ``C:\temp\py_stats\`` on Windows.
141141

142-
Use ``Tools//summarize_stats.py`` to read the stats.
142+
Use ``Tools/scripts/summarize_stats.py`` to read the stats.
143143

144144
.. versionadded:: 3.11
145145

Include/internal/pycore_code.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,15 +316,16 @@ extern PyStats _py_stats;
316316

317317
extern void _Py_PrintSpecializationStats(int to_file);
318318

319-
extern PyObject* _Py_GetSpecializationStats(void);
319+
// Used by the _opcode extension which is built as a shared library
320+
PyAPI_FUNC(PyObject*) _Py_GetSpecializationStats(void);
320321

321322
#else
322323
#define STAT_INC(opname, name) ((void)0)
323324
#define STAT_DEC(opname, name) ((void)0)
324325
#define OPCODE_EXE_INC(opname) ((void)0)
325326
#define CALL_STAT_INC(name) ((void)0)
326327
#define OBJECT_STAT_INC(name) ((void)0)
327-
#endif
328+
#endif // !Py_STATS
328329

329330
// Cache values are only valid in memory, so use native endianness.
330331
#ifdef WORDS_BIGENDIAN

0 commit comments

Comments
 (0)