aboutsummaryrefslogtreecommitdiffstats
path: root/community/qt5-qtwebengine/qt-musl-mallinfo.patch
blob: c332b92b69d347e605c7f9697605626e45fb9fda (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
39
40
--- qtwebengine/src/3rdparty/chromium/base/trace_event/malloc_dump_provider.cc	2017-11-28 14:06:53.000000000 +0100
+++ qtwebengine/src/3rdparty/chromium/base/trace_event/malloc_dump_provider.cc	2018-01-27 20:13:26.960932805 +0100
@@ -243,7 +243,7 @@
   allocated_objects_count = main_heap_info.block_count;
 #elif defined(OS_FUCHSIA)
 // TODO(fuchsia): Port, see https://crbug.com/706592.
-#else
+#elif defined(__GLIBC__)
   struct mallinfo info = mallinfo();
   DCHECK_GE(info.arena + info.hblkhd, info.uordblks);
 
@@ -255,6 +255,8 @@
 
   // Total allocated space is given by |uordblks|.
   allocated_objects_size = info.uordblks;
+#else
+// musl libc does not support mallinfo()
 #endif
 
   MemoryAllocatorDump* outer_dump = pmd->CreateAllocatorDump("malloc");
--- qtwebengine/src/3rdparty/chromium/base/process/process_metrics_posix.cc	2017-11-28 14:06:53.000000000 +0100
+++ qtwebengine/src/3rdparty/chromium/base/process/process_metrics_posix.cc	2018-01-27 20:48:11.571040348 +0100
@@ -100,14 +100,14 @@
   malloc_statistics_t stats = {0};
   malloc_zone_statistics(nullptr, &stats);
   return stats.size_in_use;
-#elif defined(OS_LINUX) || defined(OS_ANDROID)
+#elif (defined(OS_LINUX) && defined(__GLIBC__)) || defined(OS_ANDROID)
   struct mallinfo minfo = mallinfo();
 #if defined(USE_TCMALLOC)
   return minfo.uordblks;
 #else
   return minfo.hblkhd + minfo.arena;
 #endif
-#elif defined(OS_FUCHSIA)
+#else //if defined(OS_FUCHSIA) // also musl doesn't do this.
   // TODO(fuchsia): Not currently exposed. https://crbug.com/735087.
   return 0;
 #endif