44 lines
1.8 KiB
Diff
44 lines
1.8 KiB
Diff
diff --git a/src/3rdparty/chromium/base/process/process_metrics_posix.cc b/src/3rdparty/chromium/base/process/process_metrics_posix.cc
|
|
index 044bd8d24..0f2526a3d 100644
|
|
--- a/src/3rdparty/chromium/base/process/process_metrics_posix.cc
|
|
+++ b/src/3rdparty/chromium/base/process/process_metrics_posix.cc
|
|
@@ -110,14 +110,14 @@ size_t ProcessMetrics::GetMallocUsage() {
|
|
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 BUILDFLAG(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
|
|
diff --git a/src/3rdparty/chromium/base/trace_event/malloc_dump_provider.cc b/src/3rdparty/chromium/base/trace_event/malloc_dump_provider.cc
|
|
index 7e42cfc20..5086b5c8a 100644
|
|
--- a/src/3rdparty/chromium/base/trace_event/malloc_dump_provider.cc
|
|
+++ b/src/3rdparty/chromium/base/trace_event/malloc_dump_provider.cc
|
|
@@ -132,7 +132,7 @@ bool MallocDumpProvider::OnMemoryDump(const MemoryDumpArgs& args,
|
|
}
|
|
#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.
|
|
@@ -147,6 +147,8 @@ bool MallocDumpProvider::OnMemoryDump(const MemoryDumpArgs& args,
|
|
|
|
// 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");
|