aboutsummaryrefslogtreecommitdiffstats
path: root/community/chromium/no-mallinfo.patch
diff options
context:
space:
mode:
Diffstat (limited to 'community/chromium/no-mallinfo.patch')
-rw-r--r--community/chromium/no-mallinfo.patch59
1 files changed, 50 insertions, 9 deletions
diff --git a/community/chromium/no-mallinfo.patch b/community/chromium/no-mallinfo.patch
index 23ce40ec21c..37abb3fe062 100644
--- a/community/chromium/no-mallinfo.patch
+++ b/community/chromium/no-mallinfo.patch
@@ -1,16 +1,35 @@
---- ./base/trace_event/malloc_dump_provider.cc.orig
-+++ ./base/trace_event/malloc_dump_provider.cc
-@@ -212,7 +212,7 @@
+musl does not implement mallinfo()/mallinfo2()
+(or rather, malloc-ng, musl's allocator, doesn't)
+--
+--- a/base/trace_event/malloc_dump_provider.cc
++++ b/base/trace_event/malloc_dump_provider.cc
+@@ -185,7 +185,6 @@
+ #define MALLINFO2_FOUND_IN_LIBC
+ struct mallinfo2 info = mallinfo2();
+ #endif
+-#endif // defined(__GLIBC__) && defined(__GLIBC_PREREQ)
+ #if !defined(MALLINFO2_FOUND_IN_LIBC)
+ struct mallinfo info = mallinfo();
+ #endif
+@@ -205,6 +204,7 @@
+ sys_alloc_dump->AddScalar(MemoryAllocatorDump::kNameSize,
+ MemoryAllocatorDump::kUnitsBytes, info.uordblks);
+ }
++#endif // defined(__GLIBC__) && defined(__GLIBC_PREREQ)
+ }
+ #endif
+
+@@ -339,7 +340,7 @@
&allocated_objects_count);
- #elif defined(OS_FUCHSIA)
+ #elif BUILDFLAG(IS_FUCHSIA)
// TODO(fuchsia): Port, see https://crbug.com/706592.
-#else
+#elif defined(__GLIBC__)
- #if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
- #if __GLIBC_PREREQ(2, 33)
- #define MALLINFO2_FOUND_IN_LIBC
---- ./base/process/process_metrics_posix.cc.orig
-+++ ./base/process/process_metrics_posix.cc
+ ReportMallinfoStats(/*pmd=*/nullptr, &total_virtual_size, &resident_size,
+ &allocated_objects_size, &allocated_objects_count);
+ #endif
+--- a/base/process/process_metrics_posix.cc
++++ b/base/process/process_metrics_posix.cc
@@ -105,7 +105,7 @@
#endif // !BUILDFLAG(IS_FUCHSIA)
@@ -81,3 +100,25 @@
/* Define to 1 if you have the <malloc.h> header file. */
#define HAVE_MALLOC_H 1
+--- a/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_shim_default_dispatch_to_partition_alloc.cc
++++ b/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_shim_default_dispatch_to_partition_alloc.cc
+@@ -717,7 +717,7 @@
+
+ #endif // !BUILDFLAG(IS_APPLE) && !BUILDFLAG(IS_ANDROID)
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if 0
+ SHIM_ALWAYS_EXPORT struct mallinfo mallinfo(void) __THROW {
+ base::SimplePartitionStatsDumper allocator_dumper;
+ Allocator()->DumpStats("malloc", true, &allocator_dumper);
+--- a/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_shim_default_dispatch_to_partition_alloc_unittest.cc
++++ b/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_shim_default_dispatch_to_partition_alloc_unittest.cc
+@@ -24,7 +24,7 @@
+ #if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
+
+ // Platforms on which we override weak libc symbols.
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if (BUILDFLAG(IS_LINUX) && defined(__GLIBC__)) || BUILDFLAG(IS_CHROMEOS)
+
+ NOINLINE void FreeForTest(void* data) {
+ free(data);