diff options
author | Eric Snow <ericsnowcurrently@gmail.com> | 2023-06-08 20:06:54 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-08 20:06:54 (GMT) |
commit | 68dfa496278aa21585eb4654d5f7ef13ef76cb50 (patch) | |
tree | 3a3cd54110d87512915634682f18818577c57ffe /Include/internal/pycore_runtime_init.h | |
parent | 4ff5690e591b7d11cf11e34bf61004e2ea58ab3c (diff) | |
download | cpython-68dfa496278aa21585eb4654d5f7ef13ef76cb50.zip cpython-68dfa496278aa21585eb4654d5f7ef13ef76cb50.tar.gz cpython-68dfa496278aa21585eb4654d5f7ef13ef76cb50.tar.bz2 |
gh-100227: Lock Around Modification of the Global Allocators State (gh-105516)
The risk of a race with this state is relatively low, but we play it safe anyway. We do avoid using the lock in performance-sensitive cases where the risk of a race is very, very low.
Diffstat (limited to 'Include/internal/pycore_runtime_init.h')
-rw-r--r-- | Include/internal/pycore_runtime_init.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Include/internal/pycore_runtime_init.h b/Include/internal/pycore_runtime_init.h index 3b1444f..b507de0 100644 --- a/Include/internal/pycore_runtime_init.h +++ b/Include/internal/pycore_runtime_init.h @@ -25,9 +25,9 @@ extern PyTypeObject _PyExc_MemoryError; #define _PyRuntimeState_INIT(runtime) \ { \ .allocators = { \ - _pymem_allocators_standard_INIT(runtime), \ - _pymem_allocators_debug_INIT, \ - _pymem_allocators_obj_arena_INIT, \ + .standard = _pymem_allocators_standard_INIT(runtime), \ + .debug = _pymem_allocators_debug_INIT, \ + .obj_arena = _pymem_allocators_obj_arena_INIT, \ }, \ .obmalloc = _obmalloc_global_state_INIT, \ .pyhash_state = pyhash_state_INIT, \ |