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
main
Siying Dong 7 years ago committed by Facebook Github Bot
parent 90eca1e616
commit 30649dc6a1
  1. 6
      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<char[]> 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

Loading…
Cancel
Save