From 35fad15c8907f741ce21779393e4377de753e4f9 Mon Sep 17 00:00:00 2001 From: James McCoy Date: Fri, 7 Jul 2017 11:26:20 -0400 Subject: [PATCH] Prefer the static jemalloc library by default on OSX When neovim is dynamically linked against jemalloc on OSX, users are hitting the deadlock described in jemalloc/jemalloc#895. --- cmake/FindJeMalloc.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmake/FindJeMalloc.cmake b/cmake/FindJeMalloc.cmake index 820ceeed4a..f139196a38 100644 --- a/cmake/FindJeMalloc.cmake +++ b/cmake/FindJeMalloc.cmake @@ -27,6 +27,9 @@ find_path(JEMALLOC_INCLUDE_DIR jemalloc/jemalloc.h if(JEMALLOC_USE_STATIC) list(APPEND JEMALLOC_NAMES "${CMAKE_STATIC_LIBRARY_PREFIX}jemalloc${CMAKE_STATIC_LIBRARY_SUFFIX}") +elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin") + list(INSERT JEMALLOC_NAMES 0 + "${CMAKE_STATIC_LIBRARY_PREFIX}jemalloc${CMAKE_STATIC_LIBRARY_SUFFIX}") endif() list(APPEND JEMALLOC_NAMES jemalloc)