From: liusirui <liusirui@huawei.com>
To: <libc-alpha@sourceware.org>
Cc: <carlos@redhat.com>, <siddhesh@gotplt.org>, <dj@redhat.com>,
<hushiyuan@huawei.com>, <liqingqing3@huawei.com>
Subject: [PATCH] malloc: fix compile error
Date: Mon, 13 Jan 2020 20:08:27 +0800 [thread overview]
Message-ID: <1578917307-37611-1-git-send-email-liusirui@huawei.com> (raw)
Since e9c4fe93b3855239752819303ca377dff0ed0553, the commit changes struct
malloc_chunk member "size" to "mchunk_size". This cause a compile error
in function dump_heap, if macros MALLOC_DEBUG has defined and the value is
larger 1.
producing the following error message:
In file included from malloc.c:1884:0:
arena.c: In function ‘dump_heap’:
arena.c:422:58: error: ‘struct malloc_chunk’ has no member named ‘size’
fprintf (stderr, "chunk %p size %10lx", p, (long) p->size);
^~
arena.c:428:17: error: ‘struct malloc_chunk’ has no member named ‘size’
else if (p->size == (0 | PREV_INUSE))
^~
make[2]: *** [../o-iterator.mk:9: /opt/lsr/mainglibc/buildglibc/malloc/malloc.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [Makefile:470: malloc/subdir_lib] Error 2
make: *** [Makefile:9: all] Error 2
---
malloc/arena.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/malloc/arena.c b/malloc/arena.c
index 74815ac..be5c9f9 100644
--- a/malloc/arena.c
+++ b/malloc/arena.c
@@ -419,13 +419,13 @@ dump_heap (heap_info *heap)
~MALLOC_ALIGN_MASK);
for (;; )
{
- fprintf (stderr, "chunk %p size %10lx", p, (long) p->size);
+ fprintf (stderr, "chunk %p size %10lx", p, (long) chunksize_nomask(p));
if (p == top (heap->ar_ptr))
{
fprintf (stderr, " (top)\n");
break;
}
- else if (p->size == (0 | PREV_INUSE))
+ else if (chunksize_nomask(p) == (0 | PREV_INUSE))
{
fprintf (stderr, " (fence)\n");
break;
--
2.7.4
next reply other threads:[~2020-01-13 12:05 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-13 12:08 liusirui [this message]
2020-01-13 12:13 ` [PATCH] malloc: fix compile error liqingqing
-- strict thread matches above, loose matches on Subject: below --
2019-10-30 6:36 Liusirui
2019-10-30 7:27 ` liqingqing
2019-10-30 11:40 ` Carlos O'Donell
2019-10-31 3:44 ` liqingqing
2019-11-01 7:47 ` liqingqing
2019-11-01 12:49 ` Carlos O'Donell
2019-10-30 18:39 ` Florian Weimer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/libc/involved.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1578917307-37611-1-git-send-email-liusirui@huawei.com \
--to=liusirui@huawei.com \
--cc=carlos@redhat.com \
--cc=dj@redhat.com \
--cc=hushiyuan@huawei.com \
--cc=libc-alpha@sourceware.org \
--cc=liqingqing3@huawei.com \
--cc=siddhesh@gotplt.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).