summaryrefslogtreecommitdiffstats
path: root/Include/internal/pycore_runtime_init.h
diff options
context:
space:
mode:
authorEric Snow <ericsnowcurrently@gmail.com>2022-11-16 16:37:14 (GMT)
committerGitHub <noreply@github.com>2022-11-16 16:37:14 (GMT)
commit5f55067e238c21de25f09ece9bb24ae8c42d02b4 (patch)
treef3fbce5e16aaa3a8871518c4ccb18bc8a1d86e9e /Include/internal/pycore_runtime_init.h
parent5cfb7d19f5242c9b8ffd2fe30a24569e85a99e1d (diff)
downloadcpython-5f55067e238c21de25f09ece9bb24ae8c42d02b4.zip
cpython-5f55067e238c21de25f09ece9bb24ae8c42d02b4.tar.gz
cpython-5f55067e238c21de25f09ece9bb24ae8c42d02b4.tar.bz2
gh-81057: Move More Globals in Core Code to _PyRuntimeState (gh-99516)
https://github.com/python/cpython/issues/81057
Diffstat (limited to 'Include/internal/pycore_runtime_init.h')
-rw-r--r--Include/internal/pycore_runtime_init.h34
1 files changed, 21 insertions, 13 deletions
diff --git a/Include/internal/pycore_runtime_init.h b/Include/internal/pycore_runtime_init.h
index 6bdee36..37bc54f 100644
--- a/Include/internal/pycore_runtime_init.h
+++ b/Include/internal/pycore_runtime_init.h
@@ -19,30 +19,18 @@ extern "C" {
#define _PyRuntimeState_INIT(runtime) \
{ \
- .gilstate = { \
- .check_enabled = 1, \
- /* A TSS key must be initialized with Py_tss_NEEDS_INIT \
- in accordance with the specification. */ \
- .autoTSSkey = Py_tss_NEEDS_INIT, \
- }, \
.allocators = { \
_pymem_allocators_standard_INIT(runtime), \
_pymem_allocators_debug_INIT, \
_pymem_allocators_obj_arena_INIT, \
}, \
.obmalloc = _obmalloc_state_INIT(runtime.obmalloc), \
+ .pyhash_state = pyhash_state_INIT, \
.interpreters = { \
/* This prevents interpreters from getting created \
until _PyInterpreterState_Enable() is called. */ \
.next_id = -1, \
}, \
- .tracemalloc = { \
- .config = _PyTraceMalloc_Config_INIT, \
- }, \
- .dtoa = _dtoa_runtime_state_INIT(runtime), \
- .types = { \
- .next_version_tag = 1, \
- }, \
.imports = { \
.lock = { \
.mutex = NULL, \
@@ -53,6 +41,26 @@ extern "C" {
.header = 1, \
}, \
}, \
+ .gilstate = { \
+ .check_enabled = 1, \
+ /* A TSS key must be initialized with Py_tss_NEEDS_INIT \
+ in accordance with the specification. */ \
+ .autoTSSkey = Py_tss_NEEDS_INIT, \
+ }, \
+ .tracemalloc = { \
+ .config = _PyTraceMalloc_Config_INIT, \
+ }, \
+ .dtoa = _dtoa_runtime_state_INIT(runtime), \
+ .fileutils = { \
+ .force_ascii = -1, \
+ }, \
+ .float_state = { \
+ .float_format = _py_float_format_unknown, \
+ .double_format = _py_float_format_unknown, \
+ }, \
+ .types = { \
+ .next_version_tag = 1, \
+ }, \
.global_objects = { \
.singletons = { \
.small_ints = _Py_small_ints_INIT, \