aboutsummaryrefslogtreecommitdiff
blob: 170064b40068aaf7451fe532016799cd1a159b64 (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
In musl libc there is no struct mallinfo and no function mallinf()

--- qtwebengine/src/3rdparty/chromium/content/child/content_child_helpers.cc	2015-06-05 04:52:18.502230985 +0200
+++ qtwebengine/src/3rdparty/chromium/content/child/content_child_helpers.cc	2015-06-05 04:52:06.712231020 +0200
@@ -15,7 +15,7 @@

 namespace content {

-#if defined(OS_LINUX) || defined(OS_ANDROID)
+#if (defined(OS_LINUX) && defined(__GLIBC__)) || defined(OS_ANDROID)
 size_t GetMemoryUsageKB() {
   struct mallinfo minfo = mallinfo();
   uint64_t mem_usage =
--- qtwebengine/src/3rdparty/chromium/base/trace_event/malloc_dump_provider.cc	2016-03-03 15:48:36.000000000 +0100
+++ qtwebengine/src/3rdparty/chromium/base/trace_event/malloc_dump_provider.cc	2016-03-17 05:09:41.409425897 +0100
@@ -29,6 +29,7 @@
 // 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);
 
@@ -46,7 +47,7 @@
   MemoryAllocatorDump* inner_dump = pmd->CreateAllocatorDump(kAllocatedObjects);
   inner_dump->AddScalar(MemoryAllocatorDump::kNameSize,
                         MemoryAllocatorDump::kUnitsBytes, info.uordblks);
-
+#endif
   return true;
 }