fix for __sanitizer_struct_mallinfo with mallinfo2
Checks
Commit Message
Fix sanititzers with mallinfo2
e.g fedora already uses mallinfo2 with long v[10];
Comments
On Sun, Mar 19, 2023 at 11:08 PM Reini Urban via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
> Fix sanititzers with mallinfo2
> e.g fedora already uses mallinfo2 with long v[10];
Parts of these patches should go upstream first.
Thanks,
Andrew
>
> --
> Reini Urban
From 6e1ab452bcf2bae0be20faf65966c8ee2f755a2b Mon Sep 17 00:00:00 2001
From: Reini Urban <rurban@cpan.org>
Date: Sun, 20 Feb 2022 18:27:15 +0100
Subject: [PATCH 2/2] gcc: fixup report_heap_memory_use() without mallinfo2
decl
gcc/ChangeLog:
* gcc/ggc-common.cc (report_heap_memory_use): fix
without mallinfo2 decl
Signed-off-by: Reini Urban <rurban@cpan.org>
---
gcc/ggc-common.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
@@ -1276,7 +1276,7 @@ void
report_heap_memory_use ()
{
#if defined(HAVE_MALLINFO) || defined(HAVE_MALLINFO2)
-#ifdef HAVE_MALLINFO2
+#if defined HAVE_MALLINFO2 && HAVE_DECL_MALLINFO2
#define MALLINFO_FN mallinfo2
#else
#define MALLINFO_FN mallinfo
--
2.34.1