aboutsummaryrefslogtreecommitdiffstats
path: root/community/chromium/no-mallinfo.patch
blob: be571d40adb02c984ef95da73c4bcff0622e3dc8 (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
30
31
32
33
34
35
36
37
38
--- ./base/trace_event/malloc_dump_provider.cc.orig
+++ ./base/trace_event/malloc_dump_provider.cc
@@ -61,7 +61,7 @@
   // fixed quantum, so the excess region will not be resident.
   // See crrev.com/1531463004 for detailed explanation.
   resident_size = stats.max_size_in_use;
-#else
+#elif defined(__GLIBC__)
   struct mallinfo info = mallinfo();
   DCHECK_GE(info.arena + info.hblkhd, info.uordblks);
 
@@ -73,6 +73,7 @@
   allocated_objects_size = info.uordblks;
 #endif
 
+#if defined(USE_TCMALLOC) || defined(__GLIBC__) || defined(OS_MACOSX) || defined(OS_IOS)
   MemoryAllocatorDump* outer_dump = pmd->CreateAllocatorDump("malloc");
   outer_dump->AddScalar("virtual_size", MemoryAllocatorDump::kUnitsBytes,
                         total_virtual_size);
@@ -95,6 +96,7 @@
                           MemoryAllocatorDump::kUnitsBytes,
                           resident_size - allocated_objects_size);
   }
+#endif
 
   return true;
 }
--- ./content/child/content_child_helpers.cc
+++ ./content/child/content_child_helpers.cc
@@ -18,7 +18,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 =