From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 102037 invoked by alias); 23 Jul 2017 16:06:58 -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 97589 invoked by uid 89); 23 Jul 2017 16:06:54 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:842, pains, dislike X-HELO: gproxy8.mail.unifiedlayer.com Received: from gproxy8-pub.mail.unifiedlayer.com (HELO gproxy8.mail.unifiedlayer.com) (67.222.33.93) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 23 Jul 2017 16:06:53 +0000 Received: from cmgw3 (unknown [10.0.90.84]) by gproxy8.mail.unifiedlayer.com (Postfix) with ESMTP id A30901AB37A for ; Sun, 23 Jul 2017 10:06:51 -0600 (MDT) Received: from box522.bluehost.com ([74.220.219.122]) by cmgw3 with id oG6o1v00S2f2jeq01G6rxB; Sun, 23 Jul 2017 10:06:51 -0600 X-Authority-Analysis: v=2.2 cv=a95AzQaF c=1 sm=1 tr=0 a=GsOEXm/OWkKvwdLVJsfwcA==:117 a=GsOEXm/OWkKvwdLVJsfwcA==:17 a=G3gG6ho9WtcA:10 a=20KFwNOVAAAA:8 a=ri_bQmNbfH1KQlU4kM8A:9 Received: from c-67-176-62-53.hsd1.co.comcast.net ([67.176.62.53]:40818 helo=bapiya) by box522.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.87) (envelope-from ) id 1dZJP6-002NNS-8W; Sun, 23 Jul 2017 10:06:48 -0600 From: Tom Tromey To: Pedro Alves Cc: Tom Tromey , gdb-patches@sourceware.org Subject: Re: [RFA 15/23] Use std::vector to avoid cleanups References: <20170503224626.2818-1-tom@tromey.com> <20170503224626.2818-16-tom@tromey.com> <51da6cfd-42c9-536b-17b0-dbd9998e0ff4@redhat.com> Date: Sun, 23 Jul 2017 16:06:00 -0000 In-Reply-To: <51da6cfd-42c9-536b-17b0-dbd9998e0ff4@redhat.com> (Pedro Alves's message of "Fri, 2 Jun 2017 20:22:45 +0100") Message-ID: <87wp6zkui1.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-BWhitelist: no X-Exim-ID: 1dZJP6-002NNS-8W X-Source-Sender: c-67-176-62-53.hsd1.co.comcast.net (bapiya) [67.176.62.53]:40818 X-Source-Auth: tom+tromey.com X-Email-Count: 2 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTIyLmJsdWVob3N0LmNvbQ== X-Local-Domain: yes X-SW-Source: 2017-07/txt/msg00337.txt.bz2 >>>>> "Pedro" == Pedro Alves writes: Pedro> It still pains me a little to see std::vector used when we're going to Pedro> fill in the data anyway, because std::vector value/zero-initializes, Pedro> which is pointless in these cases. :-) I think I'll need to accept Pedro> that people dislike the idea of unique_ptr, so I'll stop Pedro> mentioning that, though at some point I think I may propose an Pedro> allocator that default-initializes, and then I'll nag people Pedro> to use _that_, like: I've updated the patch to use this where appppropriate. Pedro> So the patch all looks good to me, but it seems to me that in this Pedro> particular case, making this buffer be a std::string would clarify Pedro> the code: [...] I made this change as well. Tom