| Index: content/renderer/render_thread_impl.cc
|
| diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc
|
| index d3d457c8c0b27bd8f71b09411446a132b43f98d5..4012f0f31517e560ac13692479386a68394bb083 100644
|
| --- a/content/renderer/render_thread_impl.cc
|
| +++ b/content/renderer/render_thread_impl.cc
|
| @@ -1811,20 +1811,20 @@ void RenderThreadImpl::OnProcessPurgeAndSuspend() {
|
| namespace {
|
|
|
| static size_t GetMallocUsage() {
|
| - // Only checks the default process heap.
|
| - HANDLE heap = ::GetProcessHeap();
|
| - if (heap == NULL)
|
| + // Iterate through whichever heap the CRT is using.
|
| + HANDLE crt_heap = reinterpret_cast<HANDLE>(_get_heap_handle());
|
| + if (crt_heap == NULL)
|
| return 0;
|
| - if (!::HeapLock(heap))
|
| + if (!::HeapLock(crt_heap))
|
| return 0 ;
|
| size_t malloc_usage = 0;
|
| PROCESS_HEAP_ENTRY heap_entry;
|
| heap_entry.lpData = NULL;
|
| - while (::HeapWalk(heap, &heap_entry) != 0) {
|
| + while (::HeapWalk(crt_heap, &heap_entry) != 0) {
|
| if ((heap_entry.wFlags & PROCESS_HEAP_ENTRY_BUSY) != 0)
|
| malloc_usage += heap_entry.cbData;
|
| }
|
| - ::HeapUnlock(heap);
|
| + ::HeapUnlock(crt_heap);
|
| return malloc_usage;
|
| }
|
|
|
|
|