| | #ifndef Py_INTERNAL_INTERP_H |
| | #define Py_INTERNAL_INTERP_H |
| | #ifdef __cplusplus |
| | extern "C" { |
| | #endif |
| |
|
| | #ifndef Py_BUILD_CORE |
| | # error "this header requires Py_BUILD_CORE define" |
| | #endif |
| |
|
| | #include "pycore_atomic.h" |
| | #include "pycore_gil.h" |
| | #include "pycore_gc.h" |
| | #include "pycore_warnings.h" |
| |
|
| | |
| |
|
| | struct _pending_calls { |
| | PyThread_type_lock lock; |
| | |
| | _Py_atomic_int calls_to_do; |
| | |
| | |
| | |
| | int async_exc; |
| | #define NPENDINGCALLS 32 |
| | struct { |
| | int (*func)(void *); |
| | void *arg; |
| | } calls[NPENDINGCALLS]; |
| | int first; |
| | int last; |
| | }; |
| |
|
| | struct _ceval_state { |
| | int recursion_limit; |
| | |
| | |
| | |
| | |
| | |
| | int tracing_possible; |
| | |
| | |
| | _Py_atomic_int eval_breaker; |
| | |
| | _Py_atomic_int gil_drop_request; |
| | struct _pending_calls pending; |
| | }; |
| |
|
| | |
| | |
| | struct _Py_unicode_fs_codec { |
| | char *encoding; |
| | int utf8; |
| | char *errors; |
| | _Py_error_handler error_handler; |
| | }; |
| |
|
| | struct _Py_unicode_state { |
| | struct _Py_unicode_fs_codec fs_codec; |
| | }; |
| |
|
| |
|
| | |
| |
|
| | #define _PY_NSMALLPOSINTS 257 |
| | #define _PY_NSMALLNEGINTS 5 |
| |
|
| | |
| | struct _is { |
| |
|
| | struct _is *next; |
| | struct _ts *tstate_head; |
| |
|
| | |
| | |
| | |
| | struct pyruntimestate *runtime; |
| |
|
| | int64_t id; |
| | int64_t id_refcount; |
| | int requires_idref; |
| | PyThread_type_lock id_mutex; |
| |
|
| | int finalizing; |
| |
|
| | struct _ceval_state ceval; |
| | struct _gc_runtime_state gc; |
| |
|
| | PyObject *modules; |
| | PyObject *modules_by_index; |
| | PyObject *sysdict; |
| | PyObject *builtins; |
| | PyObject *importlib; |
| |
|
| | |
| | long num_threads; |
| | |
| | |
| | |
| | |
| | size_t pythread_stacksize; |
| |
|
| | PyObject *codec_search_path; |
| | PyObject *codec_search_cache; |
| | PyObject *codec_error_registry; |
| | int codecs_initialized; |
| |
|
| | struct _Py_unicode_state unicode; |
| |
|
| | PyConfig config; |
| | #ifdef HAVE_DLOPEN |
| | int dlopenflags; |
| | #endif |
| |
|
| | PyObject *dict; |
| |
|
| | PyObject *builtins_copy; |
| | PyObject *import_func; |
| | |
| | _PyFrameEvalFunction eval_frame; |
| |
|
| | Py_ssize_t co_extra_user_count; |
| | freefunc co_extra_freefuncs[MAX_CO_EXTRA_USERS]; |
| |
|
| | #ifdef HAVE_FORK |
| | PyObject *before_forkers; |
| | PyObject *after_forkers_parent; |
| | PyObject *after_forkers_child; |
| | #endif |
| | |
| | void (*pyexitfunc)(PyObject *); |
| | PyObject *pyexitmodule; |
| |
|
| | uint64_t tstate_next_unique_id; |
| |
|
| | struct _warnings_runtime_state warnings; |
| |
|
| | PyObject *audit_hooks; |
| |
|
| | struct { |
| | struct { |
| | int level; |
| | int atbol; |
| | } listnode; |
| | } parser; |
| |
|
| | #if _PY_NSMALLNEGINTS + _PY_NSMALLPOSINTS > 0 |
| | |
| | |
| | |
| | |
| | |
| | PyLongObject* small_ints[_PY_NSMALLNEGINTS + _PY_NSMALLPOSINTS]; |
| | #endif |
| |
|
| | int int_max_str_digits; |
| | }; |
| |
|
| | |
| | extern void _PyInterpreterState_ClearModules(PyInterpreterState *interp); |
| |
|
| | extern PyStatus _PyInterpreterState_SetConfig( |
| | PyInterpreterState *interp, |
| | const PyConfig *config); |
| |
|
| |
|
| |
|
| | |
| |
|
| | |
| | |
| | |
| |
|
| | struct _xidregitem; |
| |
|
| | struct _xidregitem { |
| | PyTypeObject *cls; |
| | crossinterpdatafunc getdata; |
| | struct _xidregitem *next; |
| | }; |
| |
|
| | PyAPI_FUNC(struct _is*) _PyInterpreterState_LookUpID(int64_t); |
| |
|
| | PyAPI_FUNC(int) _PyInterpreterState_IDInitref(struct _is *); |
| | PyAPI_FUNC(void) _PyInterpreterState_IDIncref(struct _is *); |
| | PyAPI_FUNC(void) _PyInterpreterState_IDDecref(struct _is *); |
| |
|
| | #ifdef __cplusplus |
| | } |
| | #endif |
| | #endif |
| |
|
| |
|