GH-131238: More refactoring of core header files (GH-131351)

Adds new pycore_stats.h header file to help break dependencies involving the pycore_code.h header.
This commit is contained in:
Mark Shannon 2025-03-17 14:41:05 +00:00 committed by GitHub
parent bb0268f60d
commit a45f25361d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
51 changed files with 264 additions and 187 deletions

View file

@ -100,9 +100,6 @@ extern void _PyInterpreterState_SetWhence(
PyInterpreterState *interp,
long whence);
extern const PyConfig* _PyInterpreterState_GetConfig(PyInterpreterState *interp);
/*
Runtime Feature Flags
@ -137,23 +134,6 @@ PyAPI_FUNC(PyStatus) _PyInterpreterState_New(
PyThreadState *tstate,
PyInterpreterState **pinterp);
#define RARE_EVENT_INTERP_INC(interp, name) \
do { \
/* saturating add */ \
int val = FT_ATOMIC_LOAD_UINT8_RELAXED(interp->rare_events.name); \
if (val < UINT8_MAX) { \
FT_ATOMIC_STORE_UINT8(interp->rare_events.name, val + 1); \
} \
RARE_EVENT_STAT_INC(name); \
} while (0); \
#define RARE_EVENT_INC(name) \
do { \
PyInterpreterState *interp = PyInterpreterState_Get(); \
RARE_EVENT_INTERP_INC(interp, name); \
} while (0); \
#ifdef __cplusplus
}
#endif