From: Pedro Alves <palves@redhat.com>
To: Joel Brobecker <brobecker@adacore.com>
Cc: Yao Qi <yao@codesourcery.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH] Fix REGISTRY cleanups
Date: Mon, 28 Oct 2013 11:36:00 -0000 [thread overview]
Message-ID: <526E4C32.7080601@redhat.com> (raw)
In-Reply-To: <20131028034520.GB3066@adacore.com>
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 <yao@codesourcery.com>
>>
>> * 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
next prev parent reply other threads:[~2013-10-28 11:36 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-26 3:50 Yao Qi
2013-10-28 3:45 ` Joel Brobecker
2013-10-28 11:36 ` Pedro Alves [this message]
2013-10-28 12:35 ` Yao Qi
2013-10-28 14:13 ` Pedro Alves
2013-10-29 6:42 ` Yao Qi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=526E4C32.7080601@redhat.com \
--to=palves@redhat.com \
--cc=brobecker@adacore.com \
--cc=gdb-patches@sourceware.org \
--cc=yao@codesourcery.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox