Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: John Baldwin <jhb@FreeBSD.org>, gdb-patches@sourceware.org
Subject: Re: [PATCH v2 2/3] Replace remaining cleanups in fbsd-nat.c.
Date: Thu, 10 Aug 2017 13:26:00 -0000	[thread overview]
Message-ID: <17564147-c872-8b13-097d-81f6dc3071c5@redhat.com> (raw)
In-Reply-To: <20170809174754.49166-3-jhb@FreeBSD.org>

On 08/09/2017 06:47 PM, John Baldwin wrote:
> +  gdb::unique_xmalloc_ptr<lwpid_t> lwps (XCNEWVEC (lwpid_t, nlwps));

> +      lwpid_t lwp = lwps.get ()[i];

I was going to say:

~~~
Note that std::unique_ptr has an array version that avoids the
get() in "lwps.get ()[i]".  I.e., with:

  gdb::unique_xmalloc_ptr<lwpid_t[]> lwps (XCNEWVEC (lwpid_t, nlwps));
                                 ^^
you can then write the more natural:

  lwpid_t lwp = lwps[i];
~~~

... but realized it doesn't work currently, because I missed adding
an xfree_deleter array specialization.  Fixed now:

 https://sourceware.org/ml/gdb-patches/2017-08/msg00212.html

Thanks,
Pedro Alves


  reply	other threads:[~2017-08-10 13:26 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-09 17:49 [PATCH v2 0/3] Some C++-ification of the FreeBSD target John Baldwin
2017-08-09 17:49 ` [PATCH v2 3/3] Replace home-grown linked-lists in FreeBSD's native target with STL lists John Baldwin
2017-08-09 18:16   ` Simon Marchi
2017-08-09 19:15     ` John Baldwin
2017-08-09 19:31       ` Simon Marchi
2017-08-09 17:49 ` [PATCH v2 1/3] Fix compile in the !HAVE_KINFO_GETVMMAP case John Baldwin
2017-08-09 17:49 ` [PATCH v2 2/3] Replace remaining cleanups in fbsd-nat.c John Baldwin
2017-08-10 13:26   ` Pedro Alves [this message]
2017-08-10 14:51     ` John Baldwin

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=17564147-c872-8b13-097d-81f6dc3071c5@redhat.com \
    --to=palves@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=jhb@FreeBSD.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