This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v2 2/3] Replace remaining cleanups in fbsd-nat.c.
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