Chromium Code Reviews| Index: third_party/tcmalloc/chromium/src/heap-profiler.cc |
| diff --git a/third_party/tcmalloc/chromium/src/heap-profiler.cc b/third_party/tcmalloc/chromium/src/heap-profiler.cc |
| index 67cb31e464d286fa30f228a9abac955fe8360f62..f51761cef70fe9a5372811a67a8694bd0b2e29e1 100644 |
| --- a/third_party/tcmalloc/chromium/src/heap-profiler.cc |
| +++ b/third_party/tcmalloc/chromium/src/heap-profiler.cc |
| @@ -225,7 +225,7 @@ static DeepHeapProfile* deep_profile = NULL; // deep memory profiler |
| //---------------------------------------------------------------------- |
| // Input must be a buffer of size at least 1MB. |
| -static char* DoGetHeapProfileLocked(char* buf, int buflen) { |
| +static char* DoGetHeapProfileLocked(char* buf, int buflen, const char* reason) { |
|
Alexander Potapenko
2013/05/27 08:54:44
It's probably better to put |reason| first. I don'
Dai Mikurube (NOT FULLTIME)
2013/05/27 10:08:24
Reasonable, too. Done.
|
| // We used to be smarter about estimating the required memory and |
| // then capping it to 1MB and generating the profile into that. |
| if (buf == NULL || buflen < 1) |
| @@ -237,7 +237,7 @@ static char* DoGetHeapProfileLocked(char* buf, int buflen) { |
| HeapProfileTable::Stats const stats = heap_profile->total(); |
| (void)stats; // avoid an unused-variable warning in non-debug mode. |
| if (deep_profile) { |
| - bytes_written = deep_profile->FillOrderedProfile(buf, buflen - 1); |
| + bytes_written = deep_profile->FillOrderedProfile(buf, buflen - 1, reason); |
| } else { |
| bytes_written = heap_profile->FillOrderedProfile(buf, buflen - 1); |
| } |
| @@ -257,7 +257,7 @@ extern "C" char* GetHeapProfile() { |
| // Use normal malloc: we return the profile to the user to free it: |
| char* buffer = reinterpret_cast<char*>(malloc(kProfileBufferSize)); |
| SpinLockHolder l(&heap_lock); |
| - return DoGetHeapProfileLocked(buffer, kProfileBufferSize); |
| + return DoGetHeapProfileLocked(buffer, kProfileBufferSize, NULL); |
|
Alexander Potapenko
2013/05/27 08:54:44
/*reason*/NULL
Dai Mikurube (NOT FULLTIME)
2013/05/27 10:08:24
Done.
|
| } |
| // defined below |
| @@ -299,7 +299,7 @@ static void DumpProfileLocked(const char* reason) { |
| } |
| char* profile = DoGetHeapProfileLocked(global_profiler_buffer, |
| - kProfileBufferSize); |
| + kProfileBufferSize, reason); |
| RawWrite(fd, profile, strlen(profile)); |
| RawClose(fd); |