Skip to content

Commit

Permalink
main/chromium: add back mallinfo hunk
Browse files Browse the repository at this point in the history
  • Loading branch information
nekopsykose committed Oct 2, 2024
1 parent 36b96df commit 1ccd6ea
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions main/chromium/patches/020-musl-no-mallinfo.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
musl does not implement mallinfo()/mallinfo2()
(or rather, malloc-ng, musl's allocator, doesn't)

for some reason only outside of x86_64 HAVE_MALLINFO gets weirdly set by something
--
--- 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
Expand Down Expand Up @@ -86,3 +88,19 @@ index 9a4428ec45..07defd5ded 100644

/* Some projects using SwiftShader bypass cmake (eg Chromium via gn) */
/* so we need to check glibc version for the new API to be safe */
--- a/third_party/swiftshader/third_party/llvm-10.0/llvm/lib/Support/Unix/Process.inc
+++ b/third_party/swiftshader/third_party/llvm-10.0/llvm/lib/Support/Unix/Process.inc
@@ -83,11 +83,11 @@ Expected<unsigned> Process::getPageSize() {
}

size_t Process::GetMallocUsage() {
-#if defined(HAVE_MALLINFO2)
+#if 0
struct mallinfo2 mi;
mi = ::mallinfo2();
return mi.uordblks;
-#elif defined(HAVE_MALLINFO)
+#elif 0
struct mallinfo mi;
mi = ::mallinfo();
return mi.uordblks;

0 comments on commit 1ccd6ea

Please sign in to comment.