--- ./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 @@ -55,6 +55,7 @@ res = get_property_function("generic.current_allocated_bytes", &allocated_objects_size); DCHECK(res); +#if defined(__GLIBC__) } else { struct mallinfo info = mallinfo(); DCHECK_GE(info.arena + info.hblkhd, info.uordblks); @@ -65,9 +66,11 @@ total_virtual_size = info.arena + info.hblkhd; resident_size = info.uordblks; allocated_objects_size = info.uordblks; +#endif } #endif +#if defined(__GLIBC__) MemoryAllocatorDump* outer_dump = pmd->CreateAllocatorDump("malloc"); outer_dump->AddScalar("virtual_size", MemoryAllocatorDump::kUnitsBytes, total_virtual_size); @@ -79,6 +82,7 @@ inner_dump->AddScalar(MemoryAllocatorDump::kNameSize, MemoryAllocatorDump::kUnitsBytes, allocated_objects_size); +#endif return true; }