This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: FYI: minor simplification in add_psymbol_to_bcache


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.

-- 
Daniel Jacobowitz
CodeSourcery


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]