From: Tom Tromey <tom@tromey.com>
To: Aaron Merey via Gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [PATCH] debuginfod-support.c: Use long-lived debuginfod_client
Date: Tue, 04 May 2021 08:27:55 -0600 [thread overview]
Message-ID: <878s4utvys.fsf@tromey.com> (raw)
In-Reply-To: <20210430235735.1371915-1-amerey@redhat.com> (Aaron Merey via Gdb-patches's message of "Fri, 30 Apr 2021 19:57:35 -0400")
>>>>> "Aaron" == Aaron Merey via Gdb-patches <gdb-patches@sourceware.org> writes:
Aaron> Instead of initializing a new debuginfod_client for each query, store
Aaron> the first initialized client for the remainder of the GDB session and
Aaron> use it for every debuginfod query.
Will this still work with existing versions of the library?
Aaron> +static debuginfod_client *global_client = nullptr;
Will there ever be a need to finalize this object? Like, shut it down
cleanly in some way?
Aaron> -static debuginfod_client_up
Aaron> +static debuginfod_client *
Aaron> debuginfod_init ()
Aaron> {
Aaron> - debuginfod_client_up c (debuginfod_begin ());
Aaron> + if (global_client == nullptr)
If global_client were defined here, rather than globally, then that
would help enforce the rule that the only way to get a
debuginfod_client* is to call debuginfod_init.
Other than this nit, the patch looks good to me.
thanks,
Tom
next prev parent reply other threads:[~2021-05-04 14:28 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-30 23:57 Aaron Merey via Gdb-patches
2021-05-04 14:27 ` Tom Tromey [this message]
2021-05-06 0:55 ` Frank Ch. Eigler via Gdb-patches
2021-05-06 17:27 ` Aaron Merey via Gdb-patches
2021-05-06 17:39 ` Tom Tromey
2021-05-06 18:03 ` Simon Marchi via Gdb-patches
2021-05-06 18:47 ` Frank Ch. Eigler via Gdb-patches
2021-05-06 19:11 ` Simon Marchi via Gdb-patches
2021-05-06 20:35 ` Aaron Merey via Gdb-patches
2021-05-06 21:45 ` Simon Marchi via Gdb-patches
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=878s4utvys.fsf@tromey.com \
--to=tom@tromey.com \
--cc=gdb-patches@sourceware.org \
/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