--- ./content/child/content_child_helpers.cc.orig +++ ./content/child/content_child_helpers.cc @@ -15,7 +15,7 @@ namespace content { -#if defined(OS_LINUX) || defined(OS_ANDROID) +#if defined(__GLIBC__) || defined(OS_ANDROID) size_t GetMemoryUsageKB() { struct mallinfo minfo = mallinfo(); uint64_t mem_usage = --- ./base/trace_event/malloc_dump_provider.cc.orig +++ ./base/trace_event/malloc_dump_provider.cc @@ -26,9 +26,10 @@ // Called at trace dump point time. Creates a snapshot the memory counters for // the current process. bool MallocDumpProvider::OnMemoryDump(ProcessMemoryDump* pmd) { +#if defined(__GLIBC__) struct mallinfo info = mallinfo(); DCHECK_GE(info.arena + info.hblkhd, info.uordblks); - +#endif MemoryAllocatorDump* dump = pmd->CreateAllocatorDump("malloc"); if (!dump) return false; --- ./base/trace_event/malloc_dump_provider.cc.orig +++ ./base/trace_event/malloc_dump_provider.cc @@ -39,12 +39,14 @@ // |arena| is 0 and the outer pages size is reported by |hblkhd|. In case of // dlmalloc the total is given by |arena| + |hblkhd|. // For more details see link: http://goo.gl/fMR8lF. +#if defined(__GLIBC__) dump->AddScalar(MemoryAllocatorDump::kNameOuterSize, MemoryAllocatorDump::kUnitsBytes, info.arena + info.hblkhd); // Total allocated space is given by |uordblks|. dump->AddScalar(MemoryAllocatorDump::kNameInnerSize, MemoryAllocatorDump::kUnitsBytes, info.uordblks); +#endif return true; }