From e4c9411e63fe5b61beb65acac19fbde9593a1e31 Mon Sep 17 00:00:00 2001 From: Jeremy B <97525434+42jeremy@users.noreply.github.com> Date: Thu, 9 Jun 2022 18:55:28 +0200 Subject: [PATCH] Correcting USE_JEMALLOC flag (#401) * Correcting USE_JEMALLOC flag * Removing references to jemalloc local copy in /libs --- libs/.gitignore | 1 - libs/jemalloc.cmake | 55 --------------------------------------- src/memory/CMakeLists.txt | 1 + 3 files changed, 1 insertion(+), 56 deletions(-) delete mode 100644 libs/jemalloc.cmake diff --git a/libs/.gitignore b/libs/.gitignore index 0be557228..0bec9e7d4 100644 --- a/libs/.gitignore +++ b/libs/.gitignore @@ -4,5 +4,4 @@ !cleanup.sh !CMakeLists.txt !__main.cpp -!jemalloc.cmake !pulsar.patch diff --git a/libs/jemalloc.cmake b/libs/jemalloc.cmake deleted file mode 100644 index 4e95c55e6..000000000 --- a/libs/jemalloc.cmake +++ /dev/null @@ -1,55 +0,0 @@ -set(JEMALLOC_DIR "${LIB_DIR}/jemalloc") - -set(JEMALLOC_SRCS - ${JEMALLOC_DIR}/src/arena.c - ${JEMALLOC_DIR}/src/background_thread.c - ${JEMALLOC_DIR}/src/base.c - ${JEMALLOC_DIR}/src/bin.c - ${JEMALLOC_DIR}/src/bitmap.c - ${JEMALLOC_DIR}/src/ckh.c - ${JEMALLOC_DIR}/src/ctl.c - ${JEMALLOC_DIR}/src/div.c - ${JEMALLOC_DIR}/src/extent.c - ${JEMALLOC_DIR}/src/extent_dss.c - ${JEMALLOC_DIR}/src/extent_mmap.c - ${JEMALLOC_DIR}/src/hash.c - ${JEMALLOC_DIR}/src/hook.c - ${JEMALLOC_DIR}/src/jemalloc.c - ${JEMALLOC_DIR}/src/large.c - ${JEMALLOC_DIR}/src/log.c - ${JEMALLOC_DIR}/src/malloc_io.c - ${JEMALLOC_DIR}/src/mutex.c - ${JEMALLOC_DIR}/src/mutex_pool.c - ${JEMALLOC_DIR}/src/nstime.c - ${JEMALLOC_DIR}/src/pages.c - ${JEMALLOC_DIR}/src/prng.c - ${JEMALLOC_DIR}/src/prof.c - ${JEMALLOC_DIR}/src/rtree.c - ${JEMALLOC_DIR}/src/sc.c - ${JEMALLOC_DIR}/src/stats.c - ${JEMALLOC_DIR}/src/sz.c - ${JEMALLOC_DIR}/src/tcache.c - ${JEMALLOC_DIR}/src/test_hooks.c - ${JEMALLOC_DIR}/src/ticker.c - ${JEMALLOC_DIR}/src/tsd.c - ${JEMALLOC_DIR}/src/witness.c - ${JEMALLOC_DIR}/src/safety_check.c -) - -add_library(jemalloc ${JEMALLOC_SRCS}) -target_include_directories(jemalloc PUBLIC "${JEMALLOC_DIR}/include") - -find_package(Threads REQUIRED) -target_link_libraries(jemalloc PUBLIC Threads::Threads) - -target_compile_definitions(jemalloc PRIVATE -DJEMALLOC_NO_PRIVATE_NAMESPACE) - -if (CMAKE_BUILD_TYPE STREQUAL "DEBUG") - target_compile_definitions(jemalloc PRIVATE -DJEMALLOC_DEBUG=1 -DJEMALLOC_PROF=1) -endif() - -target_compile_options(jemalloc PRIVATE -Wno-redundant-decls) -# for RTLD_NEXT -target_compile_definitions(jemalloc PRIVATE _GNU_SOURCE) - -set_property(TARGET jemalloc APPEND PROPERTY INTERFACE_COMPILE_DEFINITIONS USE_JEMALLOC=1) diff --git a/src/memory/CMakeLists.txt b/src/memory/CMakeLists.txt index e9de76efe..0aaf47702 100644 --- a/src/memory/CMakeLists.txt +++ b/src/memory/CMakeLists.txt @@ -9,4 +9,5 @@ target_link_libraries(mg-memory mg-utils fmt) if (ENABLE_JEMALLOC) target_link_libraries(mg-memory Jemalloc::Jemalloc) + target_compile_definitions(mg-memory PRIVATE USE_JEMALLOC=1) endif()