void-packages/srcpkgs/electron19/files/patches/chromium-libc_malloc.patch

35 lines
783 B
Diff

--- a/base/process/memory_linux.cc
+++ b/base/process/memory_linux.cc
@@ -18,6 +18,13 @@
#include "base/threading/thread_restrictions.h"
#include "build/build_config.h"
+#if defined(LIBC_GLIBC)
+extern "C" {
+extern void *__libc_malloc(size_t size);
+extern void *__libc_free(void *ptr);
+}
+#endif
+
namespace base {
namespace {
@@ -111,7 +118,7 @@
#elif defined(MEMORY_TOOL_REPLACES_ALLOCATOR) || !defined(LIBC_GLIBC)
*result = malloc(size);
#elif defined(LIBC_GLIBC)
- *result = __libc_malloc(size);
+ *result = ::__libc_malloc(size);
#endif
return *result != nullptr;
}
@@ -122,7 +129,7 @@
#elif defined(MEMORY_TOOL_REPLACES_ALLOCATOR) || !defined(LIBC_GLIBC)
free(ptr);
#elif defined(LIBC_GLIBC)
- __libc_free(ptr);
+ ::__libc_free(ptr);
#endif
}