From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 42686 invoked by alias); 10 Aug 2017 14:51:40 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 42659 invoked by uid 89); 10 Aug 2017 14:51:38 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_SOFTFAIL autolearn=no version=3.3.2 spammy= X-HELO: mail.baldwin.cx Received: from bigwig.baldwin.cx (HELO mail.baldwin.cx) (96.47.65.170) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 10 Aug 2017 14:51:36 +0000 Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id 35E6E10A8BD; Thu, 10 Aug 2017 10:51:34 -0400 (EDT) From: John Baldwin To: Pedro Alves 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 Message-ID: <17542445.RS6x9xGPvs@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: <17564147-c872-8b13-097d-81f6dc3071c5@redhat.com> References: <20170809174754.49166-1-jhb@FreeBSD.org> <20170809174754.49166-3-jhb@FreeBSD.org> <17564147-c872-8b13-097d-81f6dc3071c5@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-IsSubscribed: yes X-SW-Source: 2017-08/txt/msg00217.txt.bz2 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 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 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