mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Add debug offsets for free threaded builds (#123041)
This commit is contained in:
parent
b15b81ed4f
commit
d7a3df9150
4 changed files with 86 additions and 5 deletions
|
@ -390,7 +390,7 @@ _Py_COMP_DIAG_IGNORE_DEPR_DECLS
|
|||
Note that we initialize "initial" relative to _PyRuntime,
|
||||
to ensure pre-initialized pointers point to the active
|
||||
runtime state (and not "initial"). */
|
||||
static const _PyRuntimeState initial = _PyRuntimeState_INIT(_PyRuntime);
|
||||
static const _PyRuntimeState initial = _PyRuntimeState_INIT(_PyRuntime, "");
|
||||
_Py_COMP_DIAG_POP
|
||||
|
||||
#define LOCKS_INIT(runtime) \
|
||||
|
@ -455,6 +455,8 @@ _PyRuntimeState_Init(_PyRuntimeState *runtime)
|
|||
// Py_Initialize() must be running again.
|
||||
// Reset to _PyRuntimeState_INIT.
|
||||
memcpy(runtime, &initial, sizeof(*runtime));
|
||||
// Preserve the cookie from the original runtime.
|
||||
memcpy(runtime->debug_offsets.cookie, _Py_Debug_Cookie, 8);
|
||||
assert(!runtime->_initialized);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue