From patchwork Wed Oct 30 06:36:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: liusirui X-Patchwork-Id: 1186518 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-106441-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=huawei.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="JW6WBinG"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 472zHW4MdSz9sPK for ; Wed, 30 Oct 2019 17:36:06 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id :mime-version:content-type; q=dns; s=default; b=f1Iuj/e5m5ZI9IFo vlDjzAV8Jbs8jKzzb3YIWeuM3yrfGqUVsgw/y21YuYPb090WDpQhPgR2jJPIqDzw ij42LDYc+guqa/V+9mMC34xrq0dI2h0EzXk2f8nVIZMLBxfb7ZGFEaah+eUK4497 /DNMCpIRY1robIJMBHMTVDbi58s= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id :mime-version:content-type; s=default; bh=3CK4y76JFQyqZnpnk5brP0 9NkRM=; b=JW6WBinGxaranK1TOtjdVBsoRjkkXorFqxX2lY4QjHBR8TMOJux1+Q Ukhn++A8sezUpYwzox9alCPIdyjIr1YsUfHxhRDpVwvEv30TfH3S1IMBI3AjxEPi sjXHCtBUj3d5CbylUsAr0qduOeKYlTTuF0MDtdxArHeCHAHC9tXG0= Received: (qmail 74504 invoked by alias); 30 Oct 2019 06:35:54 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 74494 invoked by uid 89); 30 Oct 2019 06:35:54 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-24.3 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.1 spammy=H*Ad:U*dj X-HELO: huawei.com From: Liusirui To: CC: , , , , Subject: [PATCH] malloc: fix compile error Date: Wed, 30 Oct 2019 14:36:05 +0800 Message-ID: <1572417365-24412-1-git-send-email-liusirui@huawei.com> MIME-Version: 1.0 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. --- 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;