From ef46945de66abcd4029ea32ee091aa9c8223784d Mon Sep 17 00:00:00 2001 From: xia-chu <771730766@qq.com> Date: Sun, 21 Feb 2021 21:38:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=81=A2=E5=A4=8D=E4=BD=BF=E7=94=A8jemalloc?= =?UTF-8?q?=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index dd988a75..0db8dcea 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -71,6 +71,14 @@ endif () set(LINK_LIB_LIST zlmediakit zltoolkit) +#默认链接jemalloc库避免内存碎片 +find_package(JEMALLOC QUIET) +if(JEMALLOC_FOUND) + message(STATUS "found library:\"${JEMALLOC_LIBRARIES}\"") + include_directories(${JEMALLOC_INCLUDE_DIR}) + list(APPEND LINK_LIB_LIST ${JEMALLOC_LIBRARIES}) +endif() + #查找openssl是否安装 find_package(OpenSSL QUIET) if (OPENSSL_FOUND AND ENABLE_OPENSSL)