diff options
| author | Sam Gross <colesbury@gmail.com> | 2024-02-20 15:36:40 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-02-20 15:36:40 (GMT) |
| commit | cc82e33af978df793b83cefe4e25e07223a3a09e (patch) | |
| tree | d3eea26833e8ffb71fe3b19dd45e54d0e9fe33f9 /Objects/mimalloc/init.c | |
| parent | c0b0c2f2015fb27db4306109b2b3781eb2057c2b (diff) | |
| download | cpython-cc82e33af978df793b83cefe4e25e07223a3a09e.zip cpython-cc82e33af978df793b83cefe4e25e07223a3a09e.tar.gz cpython-cc82e33af978df793b83cefe4e25e07223a3a09e.tar.bz2 | |
gh-115491: Keep some fields valid across allocations (free-threading) (#115573)
This avoids filling the memory occupied by ob_tid, ob_ref_local, and
ob_ref_shared with debug bytes (e.g., 0xDD) in mimalloc in the
free-threaded build.
Diffstat (limited to 'Objects/mimalloc/init.c')
| -rw-r--r-- | Objects/mimalloc/init.c | 23 |
1 files changed, 2 insertions, 21 deletions
diff --git a/Objects/mimalloc/init.c b/Objects/mimalloc/init.c index 5897f05..cb0ef66 100644 --- a/Objects/mimalloc/init.c +++ b/Objects/mimalloc/init.c @@ -13,27 +13,7 @@ terms of the MIT license. A copy of the license can be found in the file // Empty page used to initialize the small free pages array -const mi_page_t _mi_page_empty = { - 0, false, false, false, 0, - 0, // capacity - 0, // reserved capacity - { 0 }, // flags - false, // is_zero - 0, // retire_expire - NULL, // free - 0, // used - 0, // xblock_size - NULL, // local_free - #if (MI_PADDING || MI_ENCODE_FREELIST) - { 0, 0 }, - #endif - MI_ATOMIC_VAR_INIT(0), // xthread_free - MI_ATOMIC_VAR_INIT(0), // xheap - NULL, NULL - #if MI_INTPTR_SIZE==8 - , { 0 } // padding - #endif -}; +const mi_page_t _mi_page_empty; #define MI_PAGE_EMPTY() ((mi_page_t*)&_mi_page_empty) @@ -122,6 +102,7 @@ mi_decl_cache_align const mi_heap_t _mi_heap_empty = { MI_BIN_FULL, 0, // page retired min/max NULL, // next false, + 0, 0 }; |
