mirror of
https://github.com/facebook/rocksdb.git
synced 2024-11-27 02:44:18 +00:00
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
|
#ifdef ROCKSDB_JEMALLOC
|
||||||
MallocStatus mstat;
|
MallocStatus mstat;
|
||||||
const uint kMallocStatusLen = 1000000;
|
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.cur = buf.get();
|
||||||
mstat.end = buf.get() + kMallocStatusLen;
|
mstat.end = buf.get() + kMallocStatusLen;
|
||||||
malloc_stats_print(GetJemallocStatus, &mstat, "");
|
malloc_stats_print(GetJemallocStatus, &mstat, "");
|
||||||
|
|
Loading…
Reference in a new issue