aboutsummaryrefslogtreecommitdiffstats
path: root/community/chromium/no-mallinfo.patch
blob: 0dadb3b48098797ee7c61c85dd9da70d70754dcc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
--- ./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
+++ ./base/trace_event/malloc_dump_provider.cc
@@ -30,6 +30,7 @@
 // the current process.
 bool MallocDumpProvider::OnMemoryDump(const MemoryDumpArgs& args,
                                       ProcessMemoryDump* pmd) {
+#if defined(__GLIBC__)
   struct mallinfo info = mallinfo();
   DCHECK_GE(info.arena + info.hblkhd, info.uordblks);
 
@@ -47,6 +48,7 @@
   MemoryAllocatorDump* inner_dump = pmd->CreateAllocatorDump(kAllocatedObjects);
   inner_dump->AddScalar(MemoryAllocatorDump::kNameSize,
                         MemoryAllocatorDump::kUnitsBytes, info.uordblks);
+#endif
 
   return true;
 }