From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from rock.gnat.com (rock.gnat.com [IPv6:2620:20:4000:0:a9e:1ff:fe9b:1d1]) by sourceware.org (Postfix) with ESMTP id 6A86739450DB for ; Thu, 17 Sep 2020 20:26:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 6A86739450DB Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey@adacore.com Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id D508656352; Thu, 17 Sep 2020 16:26:12 -0400 (EDT) X-Virus-Scanned: Debian amavisd-new at gnat.com Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id m8TFaK0ptNjr; Thu, 17 Sep 2020 16:26:12 -0400 (EDT) Received: from murgatroyd (75-166-120-119.hlrn.qwest.net [75.166.120.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by rock.gnat.com (Postfix) with ESMTPSA id 775E256350; Thu, 17 Sep 2020 16:26:12 -0400 (EDT) From: Tom Tromey To: Simon Marchi Cc: Tom Tromey , gdb-patches@sourceware.org Subject: Re: [PATCH] Change management of tdesc_arch_data References: <20200727193605.2224169-1-tromey@adacore.com> X-Attribution: Tom Date: Thu, 17 Sep 2020 14:26:12 -0600 In-Reply-To: (Simon Marchi's message of "Tue, 28 Jul 2020 09:41:00 -0400") Message-ID: <87wo0s5evv.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, RCVD_IN_BARRACUDACENTRAL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2020 20:26:16 -0000 >>>>> "Simon" == Simon Marchi writes: >> @@ -784,10 +784,8 @@ tdesc_data_alloc (void) >> architecture). */ >> >> void >> -tdesc_data_cleanup (void *data_untyped) >> +tdesc_arch_data_deleter::operator() (struct tdesc_arch_data *data) const Simon> I think the comment above this is not relevant, and should be made into the Simon> usual /* See foo.h. */. I made this change. >> data-> arch_regs = early_data->arch_regs; Simon> Not really important, but this could be an std::move to avoid Simon> copying the vector. And this one. >> + tdesc_arch_data_up tdesc_data; Simon> Move this where this is used, in the if? That will avoid Simon> unnecessary construction/destruction. It's used near the end of the function: if (tdesc_data != nullptr) tdesc_use_registers (gdbarch, tdesc, std::move (tdesc_data)); This pattern is typical, so I didn't change anything here. I'm going to check this patch in shortly. Tom