Allow the --enable-pystats build option to be used with free-threading. The stats are now stored on a per-interpreter basis, rather than process global. For free-threaded builds, the stats structure is allocated per-thread and then periodically merged into the per-interpreter stats structure (on thread exit or when the reporting function is called). Most of the pystats related code has be moved into the file Python/pystats.c.
22 lines
419 B
C
22 lines
419 B
C
#ifndef Py_INTERNAL_PYSTATS_H
|
|
#define Py_INTERNAL_PYSTATS_H
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
#ifndef Py_BUILD_CORE
|
|
# error "this header requires Py_BUILD_CORE define"
|
|
#endif
|
|
|
|
#ifdef Py_STATS
|
|
extern int _Py_StatsOn(void);
|
|
extern void _Py_StatsOff(void);
|
|
extern void _Py_StatsClear(void);
|
|
extern int _Py_PrintSpecializationStats(int to_file);
|
|
#endif
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
#endif // !Py_INTERNAL_PYSTATS_H
|