summaryrefslogtreecommitdiff
path: root/repo/chromium/no-mallinfo.patch
diff options
context:
space:
mode:
authordavidovski <david@davidovski.xyz>2023-02-02 14:10:02 +0000
committerdavidovski <david@davidovski.xyz>2023-02-02 14:10:02 +0000
commitf29d569cd33a73da5ad675f43a34ad53c5cc9bc6 (patch)
tree76fe6267f8307e7630fc6f53ff99a9767ad40de0 /repo/chromium/no-mallinfo.patch
parent05d004dfe0c9a9d898fac8a4a0292ca2a74ca391 (diff)
Work
Diffstat (limited to 'repo/chromium/no-mallinfo.patch')
-rw-r--r--repo/chromium/no-mallinfo.patch41
1 files changed, 34 insertions, 7 deletions
diff --git a/repo/chromium/no-mallinfo.patch b/repo/chromium/no-mallinfo.patch
index 23ce40e..675d5b0 100644
--- a/repo/chromium/no-mallinfo.patch
+++ b/repo/chromium/no-mallinfo.patch
@@ -1,14 +1,30 @@
---- ./base/trace_event/malloc_dump_provider.cc.orig
-+++ ./base/trace_event/malloc_dump_provider.cc
-@@ -212,7 +212,7 @@
+--- 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
+ ReportMallinfoStats(/*pmd=*/nullptr, &total_virtual_size, &resident_size,
+ &allocated_objects_size, &allocated_objects_count);
+ #endif
--- ./base/process/process_metrics_posix.cc.orig
+++ ./base/process/process_metrics_posix.cc
@@ -105,7 +105,7 @@
@@ -81,3 +97,14 @@
/* Define to 1 if you have the <malloc.h> header file. */
#define HAVE_MALLOC_H 1
+--- a/base/allocator/partition_allocator/shim/allocator_shim_default_dispatch_to_partition_alloc.cc
++++ b/base/allocator/partition_allocator/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);