From: John Baldwin <jhb@freebsd.org>
To: Pedro Alves <palves@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH v2 2/3] Replace remaining cleanups in fbsd-nat.c.
Date: Thu, 10 Aug 2017 14:51:00 -0000 [thread overview]
Message-ID: <17542445.RS6x9xGPvs@ralph.baldwin.cx> (raw)
In-Reply-To: <17564147-c872-8b13-097d-81f6dc3071c5@redhat.com>
On Thursday, August 10, 2017 02:24:52 PM Pedro Alves wrote:
> 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, I'll change this to use that instead.
--
John Baldwin
next prev parent reply other threads:[~2017-08-10 14:51 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 2/3] Replace remaining cleanups in fbsd-nat.c John Baldwin
2017-08-10 13:26 ` Pedro Alves
2017-08-10 14:51 ` John Baldwin [this message]
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
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=17542445.RS6x9xGPvs@ralph.baldwin.cx \
--to=jhb@freebsd.org \
--cc=gdb-patches@sourceware.org \
--cc=palves@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