diff --git a/CMakeLists.txt b/CMakeLists.txt index 7c3848e..6828322 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -50,10 +50,12 @@ cmake_pop_check_state() # https://valgrind.org/docs/manual/manual-core-adv.html#manual-core-adv.clientreq include_directories(SYSTEM ${CMAKE_SOURCE_DIR}/third_party/valgrind) -if(APPLE) - add_link_options(-Wl,-dead_strip) -else() - add_link_options(-Wl,--gc-sections) +if(CMAKE_BUILD_TYPE STREQUAL Release) + if(APPLE) + add_link_options(-Wl,-dead_strip) + else() + add_link_options(-Wl,--gc-sections) + endif() endif() set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "") diff --git a/VersionedMap.cpp b/VersionedMap.cpp index 1e3bfd8..8589c3c 100644 --- a/VersionedMap.cpp +++ b/VersionedMap.cpp @@ -951,7 +951,13 @@ struct __attribute__((__visibility__("hidden"))) VersionedMap::Impl { void firstGeq(const Key *key, const int64_t *version, Iterator *iterator, int count) const; - Random random = seededRandom(); + Random random = +#ifndef NDEBUG + {}; +#else + seededRandom(); +#endif + MemManager mm; RootSet roots; // Only meaningful within the callstack of `addMutations` @@ -1325,13 +1331,13 @@ int64_t VersionedMap::getBytes() const { return impl->getBytes(); } // GCOVR_EXCL_START -inline void VersionedMap::Impl::printInOrder(int64_t version) { +void VersionedMap::Impl::printInOrder(int64_t version) { printInOrderHelper(version, roots.getThreadSafeHandle().rootForVersion(version), 0); } -inline void VersionedMap::Impl::printInOrderHelper(int64_t version, - uint32_t node, int depth) { +void VersionedMap::Impl::printInOrderHelper(int64_t version, uint32_t node, + int depth) { if (node == 0) { return; }