mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
bpo-34301: Add _PyInterpreterState_Get() helper function (GH-8592)
sys_setcheckinterval() now uses a local variable to parse arguments, before writing into interp->check_interval.
This commit is contained in:
parent
2ebd3813af
commit
caba55b3b7
22 changed files with 107 additions and 93 deletions
|
@ -245,6 +245,13 @@ typedef struct _ts {
|
|||
PyAPI_FUNC(PyInterpreterState *) PyInterpreterState_New(void);
|
||||
PyAPI_FUNC(void) PyInterpreterState_Clear(PyInterpreterState *);
|
||||
PyAPI_FUNC(void) PyInterpreterState_Delete(PyInterpreterState *);
|
||||
#if !defined(Py_LIMITED_API)
|
||||
PyAPI_FUNC(PyInterpreterState *) _PyInterpreterState_Get(void);
|
||||
#endif
|
||||
#ifdef Py_BUILD_CORE
|
||||
/* Macro which should only be used for performance critical code */
|
||||
# define _PyInterpreterState_GET_UNSAFE() (PyThreadState_GET()->interp)
|
||||
#endif
|
||||
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03070000
|
||||
/* New in 3.7 */
|
||||
PyAPI_FUNC(int64_t) PyInterpreterState_GetID(PyInterpreterState *);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue