From patchwork Sat Oct 26 06:51:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: liusirui X-Patchwork-Id: 1184556 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-106360-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="pxAvPCIa"; 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 470WqJ2k47z9sP4 for ; Sat, 26 Oct 2019 17:51:39 +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=e0uL1vFVzG2Gl0JW 2xZSuOUdBfw7s/fyy7BNFGPNv4flbCeuR9ovQlxjs0gaPBlCDyjz5SKoHLmu5f6I K9U7+7gYWbv1gPLrHE8rsDQYVUQAdVdh22t6A4qnvLgQ66bNSQF0vcDLVimgvEOm Xff3GyT6hhPoYsodkOuVPp61LfI= 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=urM9xUcrqV7x9thYf5aYJb xztgQ=; b=pxAvPCIacEMcJWYpbDV0UH/fOzzbTJWaukaOQRse4F9xmxkznjsrxi 6CbiuBVS49M5yyy8/I1Zbk96ToWeWqkrzmZ4QZu7AnIADFTznA6sIwCFmsSNXmPY b0jgFZteMLL89stLM6AHiSfeO7l4uL953czV4fuvX0Eo9CNnclczg= Received: (qmail 97483 invoked by alias); 26 Oct 2019 06:51:32 -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 97473 invoked by uid 89); 26 Oct 2019 06:51:32 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-9.7 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*M:send X-HELO: huawei.com From: l00420122 To: CC: Subject: [PATCH] malloc: fix compile error, if sets macros Date: Sat, 26 Oct 2019 14:51:48 +0800 Message-ID: <1572072708-1904-1-git-send-email-liusirui@huawei.com> MIME-Version: 1.0 From: liusirui Since e9c4fe93b3855239752819303ca377dff0ed0553, the commit changes struct malloc_chunk member "size" to "mchunk_size". This cause a compile error in function dump_heap, with macros MALLOC_DEBUG > 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;