From: Philippe Waroquiers <philippe.waroquiers@skynet.be>
To: Pedro Alves <palves@redhat.com>, Tom Tromey <tromey@adacore.com>,
gdb-patches@sourceware.org
Subject: Re: [PATCH] Instantiate a single source highlighter
Date: Tue, 18 Jun 2019 21:25:00 -0000 [thread overview]
Message-ID: <1560893094.8865.7.camel@skynet.be> (raw)
In-Reply-To: <a42f9fe0-28c5-a3f7-c2a9-9dddc071f9c3@redhat.com>
On Tue, 2019-06-18 at 21:20 +0100, Pedro Alves wrote:
> > +/* The global source highlight object, or null if one was never
> > +  constructed. This is stored here rather than in the class so that
> > +Â Â we don't need to include anything or do conditional compilation in
> > +  source-cache.h. */
> > +#ifdef HAVE_SOURCE_HIGHLIGHT
> > +static srchilite::SourceHighlight *highlighter;
> > +#endif
>
> Should it be a unique_ptr so that valgrind doesn't complain about
> it leaking when gdb exits?
As highlighter is a global static variable,
when GDB exits, valgrind will consider the memory as reachable
and not a leak.
So, from only a valgrind point of view, there is no reason to have
GDB releasing this memory automatically when exiting.
Philippe
next prev parent reply other threads:[~2019-06-18 21:25 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-18 19:40 Tom Tromey
2019-06-18 20:00 ` Tom Tromey
2019-06-18 20:20 ` Pedro Alves
2019-06-18 21:25 ` Philippe Waroquiers [this message]
2019-06-19 11:34 ` Tom Tromey
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=1560893094.8865.7.camel@skynet.be \
--to=philippe.waroquiers@skynet.be \
--cc=gdb-patches@sourceware.org \
--cc=palves@redhat.com \
--cc=tromey@adacore.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