diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake index df937cc14cb..fa8221b4a04 100644 --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -2343,13 +2343,6 @@ if(ARROW_MIMALLOC) set(MIMALLOC_C_FLAGS "${MIMALLOC_C_FLAGS} -DERROR_COMMITMENT_MINIMUM=635") endif() - set(MIMALLOC_PATCH_COMMAND "") - if(${UPPERCASE_BUILD_TYPE} STREQUAL "DEBUG") - find_program(PATCH patch REQUIRED) - set(MIMALLOC_PATCH_COMMAND ${PATCH} -p1 -i - ${CMAKE_CURRENT_LIST_DIR}/mimalloc-1138.patch) - endif() - set(MIMALLOC_CMAKE_ARGS ${EP_COMMON_CMAKE_ARGS} "-DCMAKE_C_FLAGS=${MIMALLOC_C_FLAGS}" @@ -2367,7 +2360,6 @@ if(ARROW_MIMALLOC) ${EP_COMMON_OPTIONS} URL ${MIMALLOC_SOURCE_URL} URL_HASH "SHA256=${ARROW_MIMALLOC_BUILD_SHA256_CHECKSUM}" - PATCH_COMMAND ${MIMALLOC_PATCH_COMMAND} CMAKE_ARGS ${MIMALLOC_CMAKE_ARGS} BUILD_BYPRODUCTS "${MIMALLOC_STATIC_LIB}") diff --git a/cpp/cmake_modules/mimalloc-1138.patch b/cpp/cmake_modules/mimalloc-1138.patch deleted file mode 100644 index 1ffa4bffbba..00000000000 --- a/cpp/cmake_modules/mimalloc-1138.patch +++ /dev/null @@ -1,33 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -Fix for https://github.com/microsoft/mimalloc/issues/1138 - -diff --git a/src/arena.c b/src/arena.c -index b26f4442..d7e99b55 100644 ---- a/src/arena.c -+++ b/src/arena.c -@@ -797,6 +797,9 @@ mi_page_t* _mi_arenas_page_alloc(mi_heap_t* heap, size_t block_size, size_t bloc - else { - page = mi_arenas_page_singleton_alloc(heap, block_size, block_alignment); - } -+ if mi_unlikely(page == NULL) { -+ return NULL; -+ } - // mi_assert_internal(page == NULL || _mi_page_segment(page)->subproc == tld->subproc); - mi_assert_internal(_mi_is_aligned(page, MI_PAGE_ALIGN)); - mi_assert_internal(_mi_ptr_page(page)==page);