blob: 9f859b880848a6b14f07302605d6f08f75b06d10 (
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
|
--- base/trace_event/malloc_dump_provider.cc
+++ base/trace_event/malloc_dump_provider.cc
@@ -132,7 +132,7 @@
}
#elif defined(OS_FUCHSIA)
// TODO(fuchsia): Port, see https://crbug.com/706592.
-#else
+#elif defined(__GLIBC__)
struct mallinfo info = mallinfo();
#if !defined(ADDRESS_SANITIZER) && !defined(THREAD_SANITIZER)
// Sanitizers override mallinfo.
--- base/process/process_metrics_posix.cc
+++ base/process/process_metrics_posix.cc
@@ -110,17 +110,16 @@
malloc_statistics_t stats = {0};
malloc_zone_statistics(nullptr, &stats);
return stats.size_in_use;
-#elif defined(OS_LINUX) || defined(OS_ANDROID)
+#elif defined(__GLIBC__) || defined(OS_ANDROID)
struct mallinfo minfo = mallinfo();
#if BUILDFLAG(USE_TCMALLOC)
return minfo.uordblks;
#else
return minfo.hblkhd + minfo.arena;
#endif
-#elif defined(OS_FUCHSIA)
+#endif
// TODO(fuchsia): Not currently exposed. https://crbug.com/735087.
return 0;
-#endif
}
} // namespace base
|