From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24042 invoked by alias); 17 Aug 2012 17:11:54 -0000 Received: (qmail 24023 invoked by uid 22791); 17 Aug 2012 17:11:51 -0000 X-SWARE-Spam-Status: No, hits=-6.5 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 17 Aug 2012 17:11:38 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q7HHBbeW009599 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 17 Aug 2012 13:11:37 -0400 Received: from barimba (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q7HHBaEH001262 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Fri, 17 Aug 2012 13:11:36 -0400 From: Tom Tromey To: "H.J. Lu" Cc: Binutils Development Subject: Re: [PATCH 3/5] remove deleted BFDs from the archive cache References: <20120803160934.GE4430@bubble.grove.modra.org> <87hasdgv0h.fsf@fleche.redhat.com> <20120809101540.GA30412@bubble.grove.modra.org> <87wr0zsw9h.fsf@fleche.redhat.com> <20120816135258.GN3947@bubble.grove.modra.org> <87393mpy79.fsf@fleche.redhat.com> <20120817004825.GP3947@bubble.grove.modra.org> <20120817011722.GR3947@bubble.grove.modra.org> <87ipchlcua.fsf@fleche.redhat.com> <871uj5laxs.fsf@fleche.redhat.com> Date: Fri, 17 Aug 2012 17:22:00 -0000 In-Reply-To: (H. J. Lu's message of "Fri, 17 Aug 2012 09:59:31 -0700") Message-ID: <87r4r5jveg.fsf@fleche.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org X-SW-Source: 2012-08/txt/msg00349.txt.bz2 >>>>> "HJ" == H J Lu writes: HJ> + else HJ> + { HJ> + /* If HTAB is NULL, free ARED allocated with bfd_zmalloc. */ HJ> + free (ared); HJ> + } HJ> However, it assumes that archive member from filesystem is HJ> closed after archive. It won't be easy to get around it since HJ> we can't get from archive member from filesystem to HJ> archive. I prefer my approach, because although my patch is more complicated, the resulting code is simpler. I think this because, after my patch, an areltdata is allocated in a single way and also freed in a single way. This uniformity makes them easier to reason about. I find the above quite obscure. It assumes an invariant that is not obvious and that is also not documented. If you go with your patch, I'd recommend you also fix the latent bugs I pointed out. Some of them would require different fixes than what I posted. Tom