From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 90437 invoked by alias); 17 Oct 2016 14:07:52 -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 90428 invoked by uid 89); 17 Oct 2016 14:07:51 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy=Hx-spam-relays-external:cmgw3, Hx-spam-relays-external:10.0.90.84, H*RU:10.0.90.84, H*RU:cmgw3 X-HELO: gproxy10-pub.mail.unifiedlayer.com Received: from gproxy10-pub.mail.unifiedlayer.com (HELO gproxy10-pub.mail.unifiedlayer.com) (69.89.20.226) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with SMTP; Mon, 17 Oct 2016 14:07:41 +0000 Received: (qmail 27244 invoked by uid 0); 17 Oct 2016 14:07:39 -0000 Received: from unknown (HELO cmgw3) (10.0.90.84) by gproxy10.mail.unifiedlayer.com with SMTP; 17 Oct 2016 14:07:39 -0000 Received: from box522.bluehost.com ([74.220.219.122]) by cmgw3 with id we5C1t00J2f2jeq01e5Fx5; Mon, 17 Oct 2016 08:05:15 -0600 X-Authority-Analysis: v=2.1 cv=KLfJUj1o c=1 sm=1 tr=0 a=GsOEXm/OWkKvwdLVJsfwcA==:117 a=GsOEXm/OWkKvwdLVJsfwcA==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=CH0kA5CcgfcA:10 a=20KFwNOVAAAA:8 a=bnBBSC9TeOjHcuP-AecA:9 a=e_O65bzb51kRm2y5VmPK:22 Received: from 174-16-143-211.hlrn.qwest.net ([174.16.143.211]:48626 helo=pokyo) by box522.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.86_1) (envelope-from ) id 1bw8XP-0003K8-Un; Mon, 17 Oct 2016 08:05:12 -0600 From: Tom Tromey To: Pedro Alves Cc: Tom Tromey , gdb-patches@sourceware.org Subject: Re: [PATCH 0/3] More cleanup elimination / gdb::unique_ptr References: <1476117992-5689-1-git-send-email-palves@redhat.com> <8a49f675-dc9f-e1e9-73ae-e15522b395ae@redhat.com> <87funwlqo7.fsf@tromey.com> <27e4e7c1-fd80-d178-ecb6-0e93eef3deec@redhat.com> Date: Mon, 17 Oct 2016 14:07:00 -0000 In-Reply-To: <27e4e7c1-fd80-d178-ecb6-0e93eef3deec@redhat.com> (Pedro Alves's message of "Mon, 17 Oct 2016 14:57:22 +0100") Message-ID: <87d1iz3wbt.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-BWhitelist: no X-Exim-ID: 1bw8XP-0003K8-Un X-Source-Sender: 174-16-143-211.hlrn.qwest.net (pokyo) [174.16.143.211]:48626 X-Source-Auth: tom+tromey.com X-Email-Count: 2 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTIyLmJsdWVob3N0LmNvbQ== X-SW-Source: 2016-10/txt/msg00477.txt.bz2 >>>>> "Pedro" == Pedro Alves writes: Pedro> But I'll be happy to drop my patch instead if you'd prefer. No, please keep it. >> but note mine deletes the do_cleanups, which you don't want to do. Pedro> Looks like the last cleanup is this one: Pedro> name = xstrdup (TYPE_FIELD_NAME (type, 0)); Pedro> cleanup = make_cleanup (xfree, name); Pedro> tail = name + strlen (RUST_ENUM_PREFIX); Pedro> and, I can't figure out why we need to xstrdup at all here? The string is modified using strtok_r below. Tom