From f356d4f4722e9b690aedb52212d030a3694dcb90 Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Mon, 11 Nov 2024 09:12:57 -0600 Subject: [PATCH] Use mimalloc on all Python 3.13 builds Previously, it was only used for the freethreaded builds --- cpython-unix/build-cpython.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cpython-unix/build-cpython.sh b/cpython-unix/build-cpython.sh index eb1fe7b7..25e51d77 100755 --- a/cpython-unix/build-cpython.sh +++ b/cpython-unix/build-cpython.sh @@ -355,8 +355,14 @@ if [ -n "${CPYTHON_DEBUG}" ]; then CONFIGURE_FLAGS="${CONFIGURE_FLAGS} --with-pydebug" fi +# Explicitly enable mimalloc on 3.13+, it's already included by default but with this it'll fail +# if it's missing from the system. The MUSL builds do not supprt mimalloc yet. +if [[ -n "${PYTHON_MEETS_MINIMUM_VERSION_3_13}" && "${CC}" != "musl-clang" ]]; then + CONFIGURE_FLAGS="${CONFIGURE_FLAGS} --with-mimalloc" +fi + if [ -n "${CPYTHON_FREETHREADED}" ]; then - CONFIGURE_FLAGS="${CONFIGURE_FLAGS} --disable-gil --with-mimalloc" + CONFIGURE_FLAGS="${CONFIGURE_FLAGS} --disable-gil" fi if [ -n "${CPYTHON_OPTIMIZED}" ]; then