55 lines
1.9 KiB
Diff
55 lines
1.9 KiB
Diff
--- a/base/trace_event/malloc_dump_provider.cc.orig
|
|
+++ b/base/trace_event/malloc_dump_provider.cc
|
|
@@ -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);
|
|
|
|
--- a/base/process/process_metrics_posix.cc.orig 2019-10-24 11:10:48.553159245 -0400
|
|
+++ b/base/process/process_metrics_posix.cc 2019-10-24 11:14:29.025025854 -0400
|
|
@@ -110,14 +110,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(__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
|
|
// TODO(fuchsia): Not currently exposed. https://crbug.com/735087.
|
|
return 0;
|
|
#endif
|
|
--- a/third_party/swiftshader/third_party/llvm-subzero/lib/Support/Unix/Process.inc
|
|
+++ b/third_party/swiftshader/third_party/llvm-subzero/lib/Support/Unix/Process.inc.orig
|
|
@@ -84,7 +84,7 @@
|
|
}
|
|
|
|
size_t Process::GetMallocUsage() {
|
|
-#if defined(HAVE_MALLINFO)
|
|
+#if defined(HAVE_MALLINFO) && defined(__GLIBC__)
|
|
struct mallinfo mi;
|
|
mi = ::mallinfo();
|
|
return mi.uordblks;
|
|
|
|
--- a/third_party/swiftshader/third_party/llvm-10.0/configs/linux/include/llvm/Config/config.h.orig 2019-09-30 13:03:42.556880537 -0400
|
|
+++ b/third_party/swiftshader/third_party/llvm-10.0/configs/linux/include/llvm/Config/config.h 2019-09-30 13:07:27.989821227 -0400
|
|
@@ -122,7 +122,9 @@
|
|
/* #undef HAVE_MALLCTL */
|
|
|
|
/* Define to 1 if you have the `mallinfo' function. */
|
|
+#if defined(__GLIBC__)
|
|
#define HAVE_MALLINFO 1
|
|
+#endif
|
|
|
|
/* Define to 1 if you have the <malloc.h> header file. */
|
|
#define HAVE_MALLOC_H 1
|