From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 113665 invoked by alias); 3 Apr 2019 17:04: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 113651 invoked by uid 89); 3 Apr 2019 17:04:51 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-11.9 required=5.0 tests=BAYES_00,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 spammy=H*RU:209.85.128.65, HX-Spam-Relays-External:209.85.128.65 X-HELO: mail-wm1-f65.google.com Received: from mail-wm1-f65.google.com (HELO mail-wm1-f65.google.com) (209.85.128.65) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 03 Apr 2019 17:04:50 +0000 Received: by mail-wm1-f65.google.com with SMTP id c1so8257156wml.4 for ; Wed, 03 Apr 2019 10:04:50 -0700 (PDT) Return-Path: Received: from ?IPv6:2001:8a0:f913:f700:56ee:75ff:fe8d:232b? ([2001:8a0:f913:f700:56ee:75ff:fe8d:232b]) by smtp.gmail.com with ESMTPSA id y133sm17443553wmd.2.2019.04.03.10.04.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 Apr 2019 10:04:47 -0700 (PDT) Subject: Re: [PATCH v2 19/22] Make exception throwing a bit more efficient To: Tom Tromey , gdb-patches@sourceware.org References: <20190227201849.32210-1-tom@tromey.com> <20190227201849.32210-20-tom@tromey.com> From: Pedro Alves Message-ID: Date: Wed, 03 Apr 2019 17:04:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20190227201849.32210-20-tom@tromey.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2019-04/txt/msg00048.txt.bz2 On 02/27/2019 08:18 PM, Tom Tromey wrote: > This makes exception throwing a bit more efficient, by removing some > copies. This is good now that exceptions are more expensive to copy. It will no longer be expensive if we follow the idea of refcounting the message, but seems fine anyway. > -static ATTRIBUTE_NORETURN void > -throw_exception_cxx (struct gdb_exception exception) > +void > +throw_exception (const struct gdb_exception &exception) throw_exception (const gdb_exception &exception) ? > --- a/gdb/common/common-exceptions.h > +++ b/gdb/common/common-exceptions.h > @@ -205,7 +205,7 @@ struct gdb_quit_bad_alloc > /* Throw an exception (as described by "struct gdb_exception"), > landing in the inner most containing exception handler established > using TRY/CATCH. */ > -extern void throw_exception (struct gdb_exception exception) > +extern void throw_exception (const struct gdb_exception &exception) > ATTRIBUTE_NORETURN; Ditto. Thanks, Pedro Alves