Skip to content

Commit

Permalink
allow custom thread id, upstream of python/cpython#115488)
Browse files Browse the repository at this point in the history
  • Loading branch information
daanx committed May 19, 2024
1 parent 381da05 commit 66052f1
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion include/mimalloc/prim.h
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,13 @@ extern bool _mi_process_is_initialized; // has mi_process_init been
static inline mi_threadid_t _mi_prim_thread_id(void) mi_attr_noexcept;

// Get a unique id for the current thread.
#if defined(_WIN32)
#if defined(MI_PRIM_THREAD_ID)

static inline mi_threadid_t _mi_prim_thread_id(void) mi_attr_noexcept {
return MI_PRIM_THREAD_ID(); // used for example by CPython for a free threaded build (see python/cpython#115488)
}

#elif defined(_WIN32)

#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
Expand Down

0 comments on commit 66052f1

Please sign in to comment.