This is the mail archive of the
mailing list for the GDB project.
Re: FYI: minor simplification in add_psymbol_to_bcache
- From: Daniel Jacobowitz <drow at false dot org>
- To: Tom Tromey <tromey at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Tue, 3 Nov 2009 15:20:58 -0500
- Subject: Re: FYI: minor simplification in add_psymbol_to_bcache
- References: <firstname.lastname@example.org>
On Tue, Nov 03, 2009 at 01:10:24PM -0700, Tom Tromey wrote:
> This patch changes add_psymbol_to_bcache in two ways.
> First, it removes the gratuitous use of a 'static' local variable.
It adds a memset... if you assume that this is a hot function, then it
was probably avoided on purpose. On the other hand, the way it's
implemented is quite dodgy; there will be bogus padding if
sizeof (long) != sizeof (CORE_ADDR) and you alternate adding symbols
with VAL and COREADDR set.
> Second, it removes the copying of 'name'. I think this copy is not
> needed because SYMBOL_SET_NAMES handles this case itself.
Yes, must predate SYMBOL_SET_NAMES>
I have no objection.