From a2e4413d169a7a964b66d92f21eb0fdef23a1e6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Cumplido?= Date: Mon, 20 Jul 2026 15:12:52 +0200 Subject: [PATCH 1/6] GH-50471: [C++][Python] Bump bundled mimalloc to 3.4.1 --- cpp/thirdparty/versions.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cpp/thirdparty/versions.txt b/cpp/thirdparty/versions.txt index c6f4b01a717c..ff05b6bbae93 100644 --- a/cpp/thirdparty/versions.txt +++ b/cpp/thirdparty/versions.txt @@ -80,8 +80,8 @@ ARROW_JEMALLOC_BUILD_VERSION=5.3.0 ARROW_JEMALLOC_BUILD_SHA256_CHECKSUM=2db82d1e7119df3e71b7640219b6dfe84789bc0537983c3b7ac4f7189aecfeaa ARROW_LZ4_BUILD_VERSION=v1.10.0 ARROW_LZ4_BUILD_SHA256_CHECKSUM=537512904744b35e232912055ccf8ec66d768639ff3abe5788d90d792ec5f48b -ARROW_MIMALLOC_BUILD_VERSION=v3.3.1 -ARROW_MIMALLOC_BUILD_SHA256_CHECKSUM=42c16914168ac6741eeb407e83b93a12b2b7ee25a7e14e6b4807fab8b577a540 +ARROW_MIMALLOC_BUILD_VERSION=v3.4.1 +ARROW_MIMALLOC_BUILD_SHA256_CHECKSUM=37107a52c16baa80c5f74861dddda7b27bb9949e41a6637691867a94c88ca446 ARROW_NLOHMANN_JSON_BUILD_VERSION=v3.12.0 ARROW_NLOHMANN_JSON_BUILD_SHA256_CHECKSUM=4b92eb0c06d10683f7447ce9406cb97cd4b453be18d7279320f7b2f025c10187 ARROW_OPENTELEMETRY_BUILD_VERSION=v1.21.0 From c8e197f480320e3aa862705b7edb71ee94fb40ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Cumplido?= Date: Mon, 20 Jul 2026 15:25:24 +0200 Subject: [PATCH 2/6] Validate whether the mimalloc 3.3.1 workaround is necessary --- cpp/cmake_modules/ThirdpartyToolchain.cmake | 8 -------- 1 file changed, 8 deletions(-) diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake index 4eab2ab20869..65a457b2f12d 100644 --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -2555,16 +2555,8 @@ if(ARROW_MIMALLOC) "${MIMALLOC_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}${MIMALLOC_LIB_BASE_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}" ) - set(MIMALLOC_C_FLAGS ${EP_C_FLAGS}) - if(MINGW) - # Workaround https://github.com/microsoft/mimalloc/issues/910 on RTools40 - # This is still required as of mimalloc 3.3.1, tested as part of GH-49772 - set(MIMALLOC_C_FLAGS "${MIMALLOC_C_FLAGS} -DERROR_COMMITMENT_MINIMUM=635") - endif() - set(MIMALLOC_CMAKE_ARGS ${EP_COMMON_CMAKE_ARGS} - "-DCMAKE_C_FLAGS=${MIMALLOC_C_FLAGS}" "-DCMAKE_INSTALL_PREFIX=${MIMALLOC_PREFIX}" -DMI_INSTALL_TOPLEVEL=ON -DMI_OVERRIDE=OFF From 317632a22edd04d4d1dbf051be904527cada4c2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Cumplido?= Date: Mon, 20 Jul 2026 15:39:57 +0200 Subject: [PATCH 3/6] Revert "Validate whether the mimalloc 3.3.1 workaround is necessary" This reverts commit c8e197f480320e3aa862705b7edb71ee94fb40ec. --- cpp/cmake_modules/ThirdpartyToolchain.cmake | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake index 65a457b2f12d..4eab2ab20869 100644 --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -2555,8 +2555,16 @@ if(ARROW_MIMALLOC) "${MIMALLOC_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}${MIMALLOC_LIB_BASE_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}" ) + set(MIMALLOC_C_FLAGS ${EP_C_FLAGS}) + if(MINGW) + # Workaround https://github.com/microsoft/mimalloc/issues/910 on RTools40 + # This is still required as of mimalloc 3.3.1, tested as part of GH-49772 + set(MIMALLOC_C_FLAGS "${MIMALLOC_C_FLAGS} -DERROR_COMMITMENT_MINIMUM=635") + endif() + set(MIMALLOC_CMAKE_ARGS ${EP_COMMON_CMAKE_ARGS} + "-DCMAKE_C_FLAGS=${MIMALLOC_C_FLAGS}" "-DCMAKE_INSTALL_PREFIX=${MIMALLOC_PREFIX}" -DMI_INSTALL_TOPLEVEL=ON -DMI_OVERRIDE=OFF From 842832713dbc4a8ceae6fef31f541ac82063a142 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Cumplido?= Date: Mon, 20 Jul 2026 15:41:37 +0200 Subject: [PATCH 4/6] Update comment for workaround still required as of mimalloc v3.4.1 --- cpp/cmake_modules/ThirdpartyToolchain.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake index 4eab2ab20869..794b4c6bf726 100644 --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -2558,7 +2558,7 @@ if(ARROW_MIMALLOC) set(MIMALLOC_C_FLAGS ${EP_C_FLAGS}) if(MINGW) # Workaround https://github.com/microsoft/mimalloc/issues/910 on RTools40 - # This is still required as of mimalloc 3.3.1, tested as part of GH-49772 + # This is still required as of mimalloc 3.4.1, tested as part of GH-50471 set(MIMALLOC_C_FLAGS "${MIMALLOC_C_FLAGS} -DERROR_COMMITMENT_MINIMUM=635") endif() From 5d4c42904aaac52bfcb0d72746f2f1f2a6016f5c Mon Sep 17 00:00:00 2001 From: Antoine Pitrou Date: Mon, 20 Jul 2026 11:36:19 +0200 Subject: [PATCH 5/6] GH-50428: [C++] Better mimalloc configuration on macOS --- cpp/cmake_modules/ThirdpartyToolchain.cmake | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake index 794b4c6bf726..62942a34b954 100644 --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -2567,8 +2567,15 @@ if(ARROW_MIMALLOC) "-DCMAKE_C_FLAGS=${MIMALLOC_C_FLAGS}" "-DCMAKE_INSTALL_PREFIX=${MIMALLOC_PREFIX}" -DMI_INSTALL_TOPLEVEL=ON + # Don't override default malloc -DMI_OVERRIDE=OFF + -DMI_OSX_INTERPOSE=OFF + -DMI_OSX_ZONE=OFF + # Allow usage through dlopen (i.e. when libarrow.so itself is dlopen'ed) -DMI_LOCAL_DYNAMIC_TLS=ON + # GH-50428: Make sure several mimalloc instances can cohabit in the same process + # (also https://github.com/microsoft/mimalloc/issues/1327#issuecomment-4964140817) + -DMI_TLS_MODEL_THREAD_LOCAL=ON -DMI_BUILD_OBJECT=OFF -DMI_BUILD_SHARED=OFF -DMI_BUILD_TESTS=OFF From 43731fbb0632e6d7b0adcccf2584e1da4e8aa693 Mon Sep 17 00:00:00 2001 From: Antoine Pitrou Date: Mon, 20 Jul 2026 16:23:41 +0200 Subject: [PATCH 6/6] Fix CMake option name --- cpp/cmake_modules/ThirdpartyToolchain.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake index 62942a34b954..05808389d804 100644 --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -2575,7 +2575,7 @@ if(ARROW_MIMALLOC) -DMI_LOCAL_DYNAMIC_TLS=ON # GH-50428: Make sure several mimalloc instances can cohabit in the same process # (also https://github.com/microsoft/mimalloc/issues/1327#issuecomment-4964140817) - -DMI_TLS_MODEL_THREAD_LOCAL=ON + -DMI_TLS_MODEL_LOCAL=ON -DMI_BUILD_OBJECT=OFF -DMI_BUILD_SHARED=OFF -DMI_BUILD_TESTS=OFF