mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
[3.12] gh-100227: Lock Around Modification of the Global Allocators State (gh-105516) (gh-105532)
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.
(cherry picked from commit 68dfa49627
)
Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
This commit is contained in:
parent
3eccd95f56
commit
77c03a3b72
5 changed files with 358 additions and 228 deletions
|
@ -18,6 +18,7 @@ typedef struct {
|
|||
} debug_alloc_api_t;
|
||||
|
||||
struct _pymem_allocators {
|
||||
PyThread_type_lock mutex;
|
||||
struct {
|
||||
PyMemAllocatorEx raw;
|
||||
PyMemAllocatorEx mem;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue