mirror of https://github.com/facebook/rocksdb.git
Get unique_ptr to use delete[] for char[] in DumpMallocStats
Summary: Avoid mismatched free() / delete / delete [] in DumpMallocStats Closes https://github.com/facebook/rocksdb/pull/1927 Differential Revision: D4622045 Pulled By: siying fbshipit-source-id: 1131b30
This commit is contained in:
parent
253799c06d
commit
2ca2059f66
|
@ -604,7 +604,7 @@ static void DumpMallocStats(std::string* stats) {
|
|||
#ifdef ROCKSDB_JEMALLOC
|
||||
MallocStatus mstat;
|
||||
const uint kMallocStatusLen = 1000000;
|
||||
std::unique_ptr<char> buf{new char[kMallocStatusLen + 1]};
|
||||
std::unique_ptr<char[]> buf{new char[kMallocStatusLen + 1]};
|
||||
mstat.cur = buf.get();
|
||||
mstat.end = buf.get() + kMallocStatusLen;
|
||||
malloc_stats_print(GetJemallocStatus, &mstat, "");
|
||||
|
|
Loading…
Reference in New Issue