You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
option(MI_OSX_INTERPOSE"Use interpose to override standard malloc on macOS"ON)
19
19
option(MI_OSX_ZONE"Use malloc zone to override standard malloc on macOS"ON)
20
20
option(MI_WIN_REDIRECT"Use redirection module ('mimalloc-redirect') on Windows if compiling mimalloc as a DLL"ON)
21
-
option(MI_WIN_USE_FIXED_TLS"Use a fixed TLS slot on Windows to avoid extra tests in the malloc fast path"OFF)
21
+
option(MI_WIN_DIRECT_TLS"Use only direct TLS slots on Windows to avoid extra tests in the malloc fast path (only works if the program uses less than 64 TlsAlloc'd slots in total)"OFF)
22
22
option(MI_LOCAL_DYNAMIC_TLS"Use local-dynamic-tls, a slightly slower but dlopen-compatible thread local storage mechanism (Unix)"OFF)
23
23
option(MI_LIBC_MUSL"Enable this when linking with musl libc"OFF)
24
24
@@ -394,9 +394,9 @@ if(MI_WIN_USE_FLS)
394
394
list(APPEND mi_defines MI_WIN_USE_FLS=1)
395
395
endif()
396
396
397
-
if(MI_WIN_USE_FIXED_TLS)
398
-
message(STATUS"Use fixed TLS slot on Windows to avoid extra tests in the malloc fast path (MI_WIN_USE_FIXED_TLS=ON)")
399
-
list(APPEND mi_defines MI_WIN_USE_FIXED_TLS=1)
397
+
if(MI_WIN_DIRECT_TLS)
398
+
message(STATUS"Use only direct TLS slots on Windows to avoid extra tests in the malloc fast path -- this only works if the program uses less than 64 TlsAlloc'd slots in total! (MI_WIN_USE_ONLY_DIRECT_TLS=ON)")
399
+
list(APPEND mi_defines MI_WIN_DIRECT_TLS=1)
400
400
endif()
401
401
402
402
# Check /proc/cpuinfo for an SV39 MMU and limit the virtual address bits.
return (mi_theap_t*)mi_prim_tls_slot(_mi_theap_default_slot); // valid initial "last user slot" so it returns NULL at first leading to slot initialization
ifmi_likely(heap==NULL) { theap=__mi_theap_main; } // note: on macOS accessing the thread_local can cause allocation during thread shutdown (and reinitialize the thread)!
505
+
ifmi_likely(heap==NULL) { theap=__mi_theap_main; } // note: on macOS accessing the thread_local can cause allocation during thread shutdown (and reinitialize the thread)!
0 commit comments