void-packages/srcpkgs/qt6-pdf/patches/0132-libc_malloc.patch

35 lines
946 B
Diff

--- a/src/3rdparty/chromium/base/process/memory_linux.cc
+++ b/src/3rdparty/chromium/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 @@ bool UncheckedMalloc(size_t size, void**
#elif defined(MEMORY_TOOL_REPLACES_ALLOCATOR) || !defined(LIBC_GLIBC) || defined(TOOLKIT_QT)
*result = malloc(size);
#elif defined(LIBC_GLIBC)
- *result = __libc_malloc(size);
+ *result = ::__libc_malloc(size);
#endif
return *result != nullptr;
}
@@ -122,7 +129,7 @@ void UncheckedFree(void* ptr) {
#elif defined(MEMORY_TOOL_REPLACES_ALLOCATOR) || !defined(LIBC_GLIBC) || defined(TOOLKIT_QT)
free(ptr);
#elif defined(LIBC_GLIBC)
- __libc_free(ptr);
+ ::__libc_free(ptr);
#endif
}