From d2da3af073a63b6ae25119ebbd2e0d3c9a1b6823 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Wed, 3 Oct 2018 11:10:08 +0200 Subject: Fix T54287: memory not freed after rendering on Linux. With new jemalloc versions memory allocated by threads that then become inactive is not longer automatically freed. Instead we have to enable a background thread to do it. Some testing is needed to find out of this is sufficient, because the background thread only runs periodically. --- build_files/cmake/Modules/FindJeMalloc.cmake | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'build_files') diff --git a/build_files/cmake/Modules/FindJeMalloc.cmake b/build_files/cmake/Modules/FindJeMalloc.cmake index 506892b34ba..0abe103cd2e 100644 --- a/build_files/cmake/Modules/FindJeMalloc.cmake +++ b/build_files/cmake/Modules/FindJeMalloc.cmake @@ -53,6 +53,15 @@ FIND_LIBRARY(JEMALLOC_LIBRARY lib64 lib ) +if(JEMALLOC_INCLUDE_DIR) + SET(_version_regex "^#define[ \t]+JEMALLOC_VERSION[ \t]+\"([^\"]+)\".*") + file(STRINGS "${JEMALLOC_INCLUDE_DIR}/jemalloc.h" + JEMALLOC_VERSION REGEX "${_version_regex}") + string(REGEX REPLACE "${_version_regex}" "\\1" + JEMALLOC_VERSION "${JEMALLOC_VERSION}") + unset(_version_regex) +endif() + # handle the QUIETLY and REQUIRED arguments and set JEMALLOC_FOUND to TRUE if # all listed variables are TRUE INCLUDE(FindPackageHandleStandardArgs) -- cgit v1.2.3