From 30649dc6a10b9de3df91b76e8c1d187b43d6e8e0 Mon Sep 17 00:00:00 2001 From: Siying Dong Date: Fri, 23 Feb 2018 11:30:55 -0800 Subject: [PATCH] Have a different function when ROCKSDB_JEMALLOC=0 Summary: Some sanitizer is not happy with parameter name with ROCKSDB_JEMALLOC not set. Use another function instead. Closes https://github.com/facebook/rocksdb/pull/3536 Differential Revision: D7064849 Pulled By: siying fbshipit-source-id: c6ae94e044686176af1259df9172453d52c2f9d5 --- db/malloc_stats.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/db/malloc_stats.cc b/db/malloc_stats.cc index 603af8593..00197d04f 100644 --- a/db/malloc_stats.cc +++ b/db/malloc_stats.cc @@ -41,8 +41,8 @@ static void GetJemallocStatus(void* mstat_arg, const char* status) { } #endif // ROCKSDB_JEMALLOC -void DumpMallocStats(std::string* stats) { #ifdef ROCKSDB_JEMALLOC +void DumpMallocStats(std::string* stats) { MallocStatus mstat; const unsigned int kMallocStatusLen = 1000000; std::unique_ptr buf{new char[kMallocStatusLen + 1]}; @@ -50,8 +50,10 @@ void DumpMallocStats(std::string* stats) { mstat.end = buf.get() + kMallocStatusLen; je_malloc_stats_print(GetJemallocStatus, &mstat, ""); stats->append(buf.get()); -#endif // ROCKSDB_JEMALLOC } +#else +void DumpMallocStats(std::string*) {} +#endif // ROCKSDB_JEMALLOC } #endif // !ROCKSDB_LITE -- GitLab