From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1011 invoked by alias); 9 Sep 2009 17:30:07 -0000 Received: (qmail 953 invoked by uid 22791); 9 Sep 2009 17:30:04 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.33.17) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 09 Sep 2009 17:29:59 +0000 Received: from wpaz29.hot.corp.google.com (wpaz29.hot.corp.google.com [172.24.198.93]) by smtp-out.google.com with ESMTP id n89HTtSI032721 for ; Wed, 9 Sep 2009 18:29:56 +0100 Received: from yxe37 (yxe37.prod.google.com [10.190.2.37]) by wpaz29.hot.corp.google.com with ESMTP id n89HTX33004443 for ; Wed, 9 Sep 2009 10:29:53 -0700 Received: by yxe37 with SMTP id 37so2632724yxe.5 for ; Wed, 09 Sep 2009 10:29:53 -0700 (PDT) MIME-Version: 1.0 Received: by 10.101.193.25 with SMTP id v25mr457156anp.132.1252517393111; Wed, 09 Sep 2009 10:29:53 -0700 (PDT) In-Reply-To: References: Date: Wed, 09 Sep 2009 17:30:00 -0000 Message-ID: <8ac60eac0909091029r53400e01p985e6657522b5295@mail.gmail.com> Subject: Re: TYPE_NAME memory management From: Paul Pluzhnikov To: Doug Evans Cc: tromey@redhat.com, gdb@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-System-Of-Record: true X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2009-09/txt/msg00144.txt.bz2 On Wed, Sep 9, 2009 at 9:40 AM, Doug Evans wrote: > struct objfile_data > { > unsigned index; > /* The objfile is about to be freed. =A0Save anything needed from it. = =A0*/ > void (*save) (struct objfile *, void *); > /* Free all objfile-related resources held. =A0*/ > void (*free) (struct objfile *, void *); > }; How about s/save/cleanup/ and s/free/destroy/: > It would require adding a parameter to > register_objfile_data_with_cleanup and updating all the callers. Perhaps a new 'register_objfile_data_with_cleanup_and_destroy' function which register_objfile_data_with_cleanup can call with NULL as the destroy parameter? But then there are only 4 places which call it, so not a big deal to update them all. --=20 Paul Pluzhnikov