From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 692 invoked by alias); 28 Oct 2013 11:36:26 -0000 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 Received: (qmail 678 invoked by uid 89); 28 Oct 2013 11:36:25 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 28 Oct 2013 11:36:24 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r9SBaK9B015152 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 28 Oct 2013 07:36:20 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r9SBaJiq002130; Mon, 28 Oct 2013 07:36:19 -0400 Message-ID: <526E4C32.7080601@redhat.com> Date: Mon, 28 Oct 2013 11:36:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7 MIME-Version: 1.0 To: Joel Brobecker CC: Yao Qi , gdb-patches@sourceware.org Subject: Re: [PATCH] Fix REGISTRY cleanups References: <1382759328-23938-1-git-send-email-yao@codesourcery.com> <20131028034520.GB3066@adacore.com> In-Reply-To: <20131028034520.GB3066@adacore.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-SW-Source: 2013-10/txt/msg00849.txt.bz2 On 10/28/2013 03:45 AM, Joel Brobecker wrote: >> In registry.c:registry_clear_data, the registered data is iterated and >> invoke each 'free' function with the data passed: >> >> for (registration = data_registry->registrations, i = 0; >> i < fields->num_data; >> registration = registration->next, i++) >> if (fields->data[i] != NULL && registration->data->free != NULL) >> adaptor (registration->data->free, container, fields->data[i]); >> >> we can see that data is passed to function 'free' and data is not NULL. >> In each usage, we don't have to get the data again through key and >> do NULL pointer checking. >> >> gdb: >> >> 2013-10-26 Yao Qi >> >> * auto-load.c (auto_load_pspace_data_cleanup): Get data from >> parameter 'arg' instead of from program_space_data. >> * objfiles.c (objfiles_pspace_data_cleanup): Likewise. >> * solib-darwin.c (darwin_pspace_data_cleanup): Likewise. >> * solib-dsbt.c (dsbt_pspace_data_cleanup): Likewise. >> * solib-svr4.c (svr4_pspace_data_cleanup): Likewise. >> * inflow.c (inflow_inferior_data_cleanup): Get data from >> parameter 'arg' instead of inferior_data. > > Looks like a nice simplification (...) +1. Agreed. (Yao, FYI, "fix" in the subject line confused me a little, as I found myself scratching my head a little trying to understand what bug this actually fixes, only to realize it's a code cleanup sort of fix. I'd suggest changing the subject/commit to reflect that.) Thanks, -- Pedro Alves