Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Philippe Waroquiers <philippe.waroquiers@skynet.be>
To: Simon Marchi <simon.marchi@polymtl.ca>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFA] Fix leaks in macro definitions.
Date: Tue, 15 Jan 2019 19:55:00 -0000	[thread overview]
Message-ID: <1547582112.1726.5.camel@skynet.be> (raw)
In-Reply-To: <63b6768fbedbe46b7a46f0d29f7b178c@polymtl.ca>

On Tue, 2019-01-15 at 11:50 -0500, Simon Marchi wrote:
> > +  gdb::unique_xmalloc_ptr<char> name (extract_identifier (&exp, 0));
> > +  if (name.get () == NULL)
> 
> Nit, you don't have to use ".get ()" here.
One day, I will really have to learn some C++ :).

> 
> I think extract_identifier should return a gdb::unique_xmalloc_ptr.  
> This call site lower:
> 
>      argv[new_macro.argc] = extract_identifier (&exp, 1);
> 
> can then use ".release ()".
Yes, that looks like a cleaner approach.

I will update the patch once the question about how to
handle the splay tree leak is clarified
i.e. fix in GDB, or (incompatible) fix in libiberty.
(see other mail with Tom).

Thanks

Philippe


      parent reply	other threads:[~2019-01-15 19:55 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-15  5:56 Philippe Waroquiers
2019-01-15 16:50 ` Simon Marchi
2019-01-15 17:16   ` Tom Tromey
2019-01-15 17:49     ` Simon Marchi
2019-01-15 18:50       ` Tom Tromey
2019-01-15 22:33         ` Tom Tromey
2019-01-15 19:46     ` Philippe Waroquiers
2019-01-15 22:34       ` Tom Tromey
2019-01-17 22:25         ` Tom Tromey
2019-01-19 17:32           ` Philippe Waroquiers
2019-01-19 20:05             ` Tom Tromey
2019-01-15 19:55   ` Philippe Waroquiers [this message]

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=1547582112.1726.5.camel@skynet.be \
    --to=philippe.waroquiers@skynet.be \
    --cc=gdb-patches@sourceware.org \
    --cc=simon.marchi@polymtl.ca \
    /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