mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-05-06 23:33:47 +08:00
升级jemalloc到5.3版本 (#2884)
升级jemalloc到5.3版本,相比5.2.1内存稳定许多,去除--without-export编译参数, 解决类似glibc中分配内存却在jemalloc中释放导致崩溃问题. 比如: toolkit::LoggerWrapper::printLogV中使用的vasprintf
This commit is contained in:
@@ -1,21 +1,34 @@
|
||||
# Download and build Jemalloc
|
||||
|
||||
set(JEMALLOC_VERSION 5.2.1)
|
||||
set(JEMALLOC_VERSION 5.3.0)
|
||||
set(JEMALLOC_NAME jemalloc-${JEMALLOC_VERSION})
|
||||
set(JEMALLOC_TAR_PATH ${DEP_ROOT_DIR}/${JEMALLOC_NAME}.tar.bz2)
|
||||
|
||||
list(APPEND jemalloc_CONFIG_ARGS --disable-initial-exec-tls)
|
||||
list(APPEND jemalloc_CONFIG_ARGS --without-export)
|
||||
#list(APPEND jemalloc_CONFIG_ARGS --without-export)
|
||||
if (ENABLE_JEMALLOC_STAT)
|
||||
list(APPEND jemalloc_CONFIG_ARGS --enable-stats)
|
||||
message(STATUS "Jemalloc stats enabled")
|
||||
else ()
|
||||
list(APPEND jemalloc_CONFIG_ARGS --disable-stats)
|
||||
message(STATUS "Jemalloc stats disabled")
|
||||
endif ()
|
||||
list(APPEND jemalloc_CONFIG_ARGS --disable-libdl)
|
||||
#list(APPEND jemalloc_CONFIG_ARGS --disable-cxx)
|
||||
#list(APPEND jemalloc_CONFIG_ARGS --with-jemalloc-prefix=je_)
|
||||
#list(APPEND jemalloc_CONFIG_ARGS --enable-debug)
|
||||
|
||||
if(NOT EXISTS ${JEMALLOC_TAR_PATH})
|
||||
message(STATUS "Downloading ${JEMALLOC_NAME}...")
|
||||
file(DOWNLOAD https://github.com/jemalloc/jemalloc/releases/download/${JEMALLOC_VERSION}/${JEMALLOC_NAME}.tar.bz2
|
||||
${JEMALLOC_TAR_PATH})
|
||||
set(JEMALLOC_URL https://github.com/jemalloc/jemalloc/releases/download/${JEMALLOC_VERSION}/${JEMALLOC_NAME}.tar.bz2)
|
||||
message(STATUS "Downloading ${JEMALLOC_NAME} from ${JEMALLOC_URL}")
|
||||
file(DOWNLOAD ${JEMALLOC_URL} ${JEMALLOC_TAR_PATH} SHOW_PROGRESS STATUS JEMALLOC_DOWNLOAD_STATUS LOG JEMALLOC_DOWNLOAD_LOG)
|
||||
list(GET JEMALLOC_DOWNLOAD_STATUS 0 JEMALLOC_DOWNLOAD_STATUS_CODE)
|
||||
if(NOT JEMALLOC_DOWNLOAD_STATUS_CODE EQUAL 0)
|
||||
file(REMOVE ${JEMALLOC_TAR_PATH})
|
||||
message(STATUS "${JEMALLOC_DOWNLOAD_LOG}")
|
||||
message(FATAL_ERROR "${JEMALLOC_NAME} download failed! error is ${JEMALLOC_DOWNLOAD_STATUS}")
|
||||
return()
|
||||
endif ()
|
||||
endif()
|
||||
|
||||
SET( DIR_CONTAINING_JEMALLOC ${DEP_ROOT_DIR}/${JEMALLOC_NAME} )
|
||||
|
||||
Reference in New Issue
Block a user