From c780e77756e45786b726e9df3559693d41d7d4ed Mon Sep 17 00:00:00 2001 From: Sam Gross Date: Thu, 15 Feb 2024 14:49:46 +0000 Subject: [PATCH] gh-112529: Revert "Use _PyThread_Id() in mimalloc in free-threaded build" Reverts: python/cpython#115488 Reason: Free-threaded Ubuntu buildbots are timing out --- Include/internal/mimalloc/mimalloc/prim.h | 8 +------- Include/internal/pycore_mimalloc.h | 9 +++------ 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/Include/internal/mimalloc/mimalloc/prim.h b/Include/internal/mimalloc/mimalloc/prim.h index 8a60d528458e6c..4b9e4dc4194d77 100644 --- a/Include/internal/mimalloc/mimalloc/prim.h +++ b/Include/internal/mimalloc/mimalloc/prim.h @@ -131,13 +131,7 @@ extern bool _mi_process_is_initialized; // has mi_process_init been static inline mi_threadid_t _mi_prim_thread_id(void) mi_attr_noexcept; -#ifdef MI_PRIM_THREAD_ID - -static inline mi_threadid_t _mi_prim_thread_id(void) mi_attr_noexcept { - return MI_PRIM_THREAD_ID(); -} - -#elif defined(_WIN32) +#if defined(_WIN32) #define WIN32_LEAN_AND_MEAN #include diff --git a/Include/internal/pycore_mimalloc.h b/Include/internal/pycore_mimalloc.h index 14c98108ec131e..1e7ed5a4ca62e2 100644 --- a/Include/internal/pycore_mimalloc.h +++ b/Include/internal/pycore_mimalloc.h @@ -20,12 +20,9 @@ typedef enum { #include "pycore_pymem.h" #ifdef WITH_MIMALLOC -# ifdef Py_GIL_DISABLED -# define MI_PRIM_THREAD_ID _Py_ThreadId -# endif -# define MI_DEBUG_UNINIT PYMEM_CLEANBYTE -# define MI_DEBUG_FREED PYMEM_DEADBYTE -# define MI_DEBUG_PADDING PYMEM_FORBIDDENBYTE +#define MI_DEBUG_UNINIT PYMEM_CLEANBYTE +#define MI_DEBUG_FREED PYMEM_DEADBYTE +#define MI_DEBUG_PADDING PYMEM_FORBIDDENBYTE #ifdef Py_DEBUG # define MI_DEBUG 1 #else