From: Doug Evans <dje@google.com>
To: Paul Pluzhnikov <ppluzhnikov@google.com>
Cc: tromey@redhat.com, gdb@sourceware.org
Subject: Re: TYPE_NAME memory management
Date: Wed, 09 Sep 2009 17:38:00 -0000 [thread overview]
Message-ID: <e394668d0909091038s437d3c36n711a15f30794e03@mail.gmail.com> (raw)
In-Reply-To: <8ac60eac0909091029r53400e01p985e6657522b5295@mail.gmail.com>
On Wed, Sep 9, 2009 at 10:29 AM, Paul Pluzhnikov<ppluzhnikov@google.com> wrote:
> On Wed, Sep 9, 2009 at 9:40 AM, Doug Evans<dje@google.com> wrote:
>
>> struct objfile_data
>> {
>> unsigned index;
>> /* The objfile is about to be freed. Save anything needed from it. */
>> void (*save) (struct objfile *, void *);
>> /* Free all objfile-related resources held. */
>> void (*free) (struct objfile *, void *);
>> };
>
> How about s/save/cleanup/ and s/free/destroy/:
[fwiw]
I chose to stay away from "cleanup" because cleanups in gdb have the
connotation of freeing resources, which we want the cleanup in
"cleanup/destroy" to explicitly not do.
>> 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?
Yeah, though given that I was explicitly staying away from "cleanup"
in the name of the functions to call I chose to avoid this.
[I don't mind "cleanup" appearing in
register_objfile_data_with_cleanup because here it encompasses both
the "save" and "free" routines.]
> But then there are only 4 places which call it, so not a big deal to
> update them all.
Yeah, that was my thinking.
next prev parent reply other threads:[~2009-09-09 17:38 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-04 21:18 Doug Evans
2009-09-04 22:42 ` Tom Tromey
2009-09-04 22:54 ` Doug Evans
2009-09-04 23:04 ` Joel Brobecker
2009-09-09 16:40 ` Doug Evans
2009-09-09 17:30 ` Paul Pluzhnikov
2009-09-09 17:38 ` Doug Evans [this message]
2009-09-09 17:46 ` Tom Tromey
2009-09-04 22:44 ` Joel Brobecker
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=e394668d0909091038s437d3c36n711a15f30794e03@mail.gmail.com \
--to=dje@google.com \
--cc=gdb@sourceware.org \
--cc=ppluzhnikov@google.com \
--cc=tromey@redhat.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