Skip to content

Commit 4e4375f

Browse files
committed
Use FLS init
1 parent 0fa01f3 commit 4e4375f

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎Include/internal/pycore_mimalloc.h‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ typedef enum {
2121

2222
#ifdef WITH_MIMALLOC
2323
# define MI_NO_PTHREAD_ATFORK 1
24+
# ifdef MS_WINDOWS
25+
// Initialize from a CRT initializer and use FLS for thread cleanup instead
26+
// of TLS callbacks, which run during DLL attach before the CRT is set up.
27+
# define MI_WIN_INIT_USE_FLS 1
28+
# endif
2429
# ifdef Py_GIL_DISABLED
2530
# define MI_PRIM_THREAD_ID _Py_ThreadId
2631
# define MI_CPYTHON 1

0 commit comments

Comments
 (0)