[3.13] Add debug offsets for free threaded builds (GH-123041) (#123055)

* Add debug offsets for free threaded builds (GH-123041)
(cherry picked from commit d7a3df9150)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>

* Refresh ABI file

---------

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
This commit is contained in:
Miss Islington (bot) 2024-08-18 17:01:16 +02:00 committed by GitHub
parent b5bba3bb6c
commit 01ce10c690
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 20221 additions and 20323 deletions

View file

@ -389,7 +389,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) \
@ -454,6 +454,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);
}