This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v2 19/22] Make exception throwing a bit more efficient
- From: Pedro Alves <palves at redhat dot com>
- To: Tom Tromey <tom at tromey dot com>, gdb-patches at sourceware dot org
- Date: Wed, 3 Apr 2019 18:04:47 +0100
- Subject: Re: [PATCH v2 19/22] Make exception throwing a bit more efficient
- References: <20190227201849.32210-1-tom@tromey.com> <20190227201849.32210-20-tom@tromey.com>
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