From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26363 invoked by alias); 13 Sep 2008 17:58:06 -0000 Received: (qmail 26348 invoked by uid 22791); 13 Sep 2008 17:58:06 -0000 X-Spam-Check-By: sourceware.org Received: from mx2.redhat.com (HELO mx2.redhat.com) (66.187.237.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 13 Sep 2008 17:57:31 +0000 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id m8DHu8wM032413; Sat, 13 Sep 2008 13:56:28 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m8DHtu0Q024712; Sat, 13 Sep 2008 13:55:57 -0400 Received: from opsy.redhat.com (vpn-10-13.bos.redhat.com [10.16.10.13]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id m8DHttSq026602; Sat, 13 Sep 2008 13:55:55 -0400 Received: by opsy.redhat.com (Postfix, from userid 500) id 949B288803A; Sat, 13 Sep 2008 11:56:02 -0600 (MDT) To: Joel Brobecker Cc: gdb-patches@sourceware.org Subject: Re: RFA: fix minor memory leak in symfile.c References: <20080913171723.GH3714@adacore.com> From: Tom Tromey Reply-To: Tom Tromey X-Attribution: Tom Date: Sat, 13 Sep 2008 17:58:00 -0000 In-Reply-To: <20080913171723.GH3714@adacore.com> (Joel Brobecker's message of "Sat\, 13 Sep 2008 10\:17\:23 -0700") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-09/txt/msg00297.txt.bz2 >>>>> "Joel" == Joel Brobecker writes: >> While auditing other callers of build_id_bfd_get, I found a use of >> 'free', so I fixed that as well. (Perhaps we ought to poison "free"?) Joel> I think that's a good idea, since I don't think there is any case Joel> besides the xfree implementation where we want to call free. Same Joel> for malloc as well. But I'm not very familiar with the pros and Joel> cons of this GCC pragma. It works in the lexer, so it is fairly primitive. I tried it and ran into a few problems. vec.h uses the token 'free'. struct dict_vector has a field named 'free'. And, bison uses 'free', but IIRC we #define it to xfree somewhere. So, I think this probably isn't worth pursuing. I did find a few stray uses of free. I can send that patch if you like. I'm not even sure if this matters -- I suppose the justification for xfree is not as strong as that for xmalloc. Tom