aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Include/internal/pycore_runtime_init.h
diff options
context:
space:
mode:
Diffstat (limited to 'Include/internal/pycore_runtime_init.h')
-rw-r--r--Include/internal/pycore_runtime_init.h107
1 files changed, 2 insertions, 105 deletions
diff --git a/Include/internal/pycore_runtime_init.h b/Include/internal/pycore_runtime_init.h
index a17ba46966d..e99febab2f3 100644
--- a/Include/internal/pycore_runtime_init.h
+++ b/Include/internal/pycore_runtime_init.h
@@ -9,6 +9,7 @@ extern "C" {
#endif
#include "pycore_ceval_state.h" // _PyEval_RUNTIME_PERF_INIT
+#include "pycore_debug_offsets.h" // _Py_DebugOffsets_INIT()
#include "pycore_faulthandler.h" // _faulthandler_runtime_state_INIT
#include "pycore_floatobject.h" // _py_float_format_unknown
#include "pycore_function.h"
@@ -32,111 +33,7 @@ extern PyTypeObject _PyExc_MemoryError;
#define _PyRuntimeState_INIT(runtime, debug_cookie) \
{ \
- .debug_offsets = { \
- .cookie = debug_cookie, \
- .version = PY_VERSION_HEX, \
- .free_threaded = _Py_Debug_Free_Threaded, \
- .runtime_state = { \
- .size = sizeof(_PyRuntimeState), \
- .finalizing = offsetof(_PyRuntimeState, _finalizing), \
- .interpreters_head = offsetof(_PyRuntimeState, interpreters.head), \
- }, \
- .interpreter_state = { \
- .size = sizeof(PyInterpreterState), \
- .id = offsetof(PyInterpreterState, id), \
- .next = offsetof(PyInterpreterState, next), \
- .threads_head = offsetof(PyInterpreterState, threads.head), \
- .gc = offsetof(PyInterpreterState, gc), \
- .imports_modules = offsetof(PyInterpreterState, imports.modules), \
- .sysdict = offsetof(PyInterpreterState, sysdict), \
- .builtins = offsetof(PyInterpreterState, builtins), \
- .ceval_gil = offsetof(PyInterpreterState, ceval.gil), \
- .gil_runtime_state = offsetof(PyInterpreterState, _gil), \
- .gil_runtime_state_enabled = _Py_Debug_gilruntimestate_enabled, \
- .gil_runtime_state_locked = offsetof(PyInterpreterState, _gil.locked), \
- .gil_runtime_state_holder = offsetof(PyInterpreterState, _gil.last_holder), \
- }, \
- .thread_state = { \
- .size = sizeof(PyThreadState), \
- .prev = offsetof(PyThreadState, prev), \
- .next = offsetof(PyThreadState, next), \
- .interp = offsetof(PyThreadState, interp), \
- .current_frame = offsetof(PyThreadState, current_frame), \
- .thread_id = offsetof(PyThreadState, thread_id), \
- .native_thread_id = offsetof(PyThreadState, native_thread_id), \
- .datastack_chunk = offsetof(PyThreadState, datastack_chunk), \
- .status = offsetof(PyThreadState, _status), \
- }, \
- .interpreter_frame = { \
- .size = sizeof(_PyInterpreterFrame), \
- .previous = offsetof(_PyInterpreterFrame, previous), \
- .executable = offsetof(_PyInterpreterFrame, f_executable), \
- .instr_ptr = offsetof(_PyInterpreterFrame, instr_ptr), \
- .localsplus = offsetof(_PyInterpreterFrame, localsplus), \
- .owner = offsetof(_PyInterpreterFrame, owner), \
- }, \
- .code_object = { \
- .size = sizeof(PyCodeObject), \
- .filename = offsetof(PyCodeObject, co_filename), \
- .name = offsetof(PyCodeObject, co_name), \
- .qualname = offsetof(PyCodeObject, co_qualname), \
- .linetable = offsetof(PyCodeObject, co_linetable), \
- .firstlineno = offsetof(PyCodeObject, co_firstlineno), \
- .argcount = offsetof(PyCodeObject, co_argcount), \
- .localsplusnames = offsetof(PyCodeObject, co_localsplusnames), \
- .localspluskinds = offsetof(PyCodeObject, co_localspluskinds), \
- .co_code_adaptive = offsetof(PyCodeObject, co_code_adaptive), \
- }, \
- .pyobject = { \
- .size = sizeof(PyObject), \
- .ob_type = offsetof(PyObject, ob_type), \
- }, \
- .type_object = { \
- .size = sizeof(PyTypeObject), \
- .tp_name = offsetof(PyTypeObject, tp_name), \
- .tp_repr = offsetof(PyTypeObject, tp_repr), \
- .tp_flags = offsetof(PyTypeObject, tp_flags), \
- }, \
- .tuple_object = { \
- .size = sizeof(PyTupleObject), \
- .ob_item = offsetof(PyTupleObject, ob_item), \
- .ob_size = offsetof(PyTupleObject, ob_base.ob_size), \
- }, \
- .list_object = { \
- .size = sizeof(PyListObject), \
- .ob_item = offsetof(PyListObject, ob_item), \
- .ob_size = offsetof(PyListObject, ob_base.ob_size), \
- }, \
- .dict_object = { \
- .size = sizeof(PyDictObject), \
- .ma_keys = offsetof(PyDictObject, ma_keys), \
- .ma_values = offsetof(PyDictObject, ma_values), \
- }, \
- .float_object = { \
- .size = sizeof(PyFloatObject), \
- .ob_fval = offsetof(PyFloatObject, ob_fval), \
- }, \
- .long_object = { \
- .size = sizeof(PyLongObject), \
- .lv_tag = offsetof(PyLongObject, long_value.lv_tag), \
- .ob_digit = offsetof(PyLongObject, long_value.ob_digit), \
- }, \
- .bytes_object = { \
- .size = sizeof(PyBytesObject), \
- .ob_size = offsetof(PyBytesObject, ob_base.ob_size), \
- .ob_sval = offsetof(PyBytesObject, ob_sval), \
- }, \
- .unicode_object = { \
- .size = sizeof(PyUnicodeObject), \
- .state = offsetof(PyUnicodeObject, _base._base.state), \
- .length = offsetof(PyUnicodeObject, _base._base.length), \
- .asciiobject_size = sizeof(PyASCIIObject), \
- }, \
- .gc = { \
- .size = sizeof(struct _gc_runtime_state), \
- .collecting = offsetof(struct _gc_runtime_state, collecting), \
- }, \
- }, \
+ .debug_offsets = _Py_DebugOffsets_INIT(debug_cookie), \
.allocators = { \
.standard = _pymem_allocators_standard_INIT(runtime), \
.debug = _pymem_allocators_debug_INIT, \