bpo-29102: Add a unique ID to PyInterpreterState. (#1639)

This commit is contained in:
Eric Snow 2017-05-22 19:46:40 -07:00 committed by GitHub
parent 93fc20b73e
commit e377416c10
8 changed files with 152 additions and 7 deletions

View file

@ -28,6 +28,8 @@ typedef struct _is {
struct _is *next;
struct _ts *tstate_head;
int64_t id;
PyObject *modules;
PyObject *modules_by_index;
PyObject *sysdict;
@ -154,9 +156,16 @@ typedef struct _ts {
#endif
#ifndef Py_LIMITED_API
PyAPI_FUNC(void) _PyInterpreterState_Init(void);
#endif /* !Py_LIMITED_API */
PyAPI_FUNC(PyInterpreterState *) PyInterpreterState_New(void);
PyAPI_FUNC(void) PyInterpreterState_Clear(PyInterpreterState *);
PyAPI_FUNC(void) PyInterpreterState_Delete(PyInterpreterState *);
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03070000
/* New in 3.7 */
PyAPI_FUNC(int64_t) PyInterpreterState_GetID(PyInterpreterState *);
#endif
#ifndef Py_LIMITED_API
PyAPI_FUNC(int) _PyState_AddModule(PyObject*, struct PyModuleDef*);
#endif /* !Py_LIMITED_API */