8000 allow custom thread id, upstream of python/cpython#115488) · microsoft/mimalloc@66052f1 · GitHub
[go: up one dir, main page]

Skip to content

Commit 66052f1

Browse files
committed
allow custom thread id, upstream of python/cpython#115488)
1 parent 381da05 commit 66052f1

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

include/mimalloc/prim.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,13 @@ extern bool _mi_process_is_initialized; // has mi_process_init been
222222
static inline mi_threadid_t _mi_prim_thread_id(void) mi_attr_noexcept;
223223

224224
// Get a unique id for the current thread.
225-
#if defined(_WIN32)
225+
#if defined(MI_PRIM_THREAD_ID)
226+
227+
static inline mi_threadid_t _mi_prim_thread_id(void) mi_attr_noexcept {
228+
return MI_PRIM_THREAD_ID(); // used for example by CPython for a free threaded build (see python/cpython#115488)
229+
}
230+
231+
#elif defined(_WIN32)
226232

227233
#ifndef WIN32_LEAN_AND_MEAN
228234
#define WIN32_LEAN_AND_MEAN

0 commit comments

Comments
 (0)
0