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: [RFC] Use custom hash function with bcache


On Mon, Aug 16, 2010 at 10:10:41AM -0400, sami wagiaalla wrote:
> This patch enables the use of custom hash and comparison functions
> when adding elements to a bcache. The patch also introduces hash and
> comparison functions which take into consideration only the relevant
> properties of the psymbol.

This patch makes me nervous because it's violating the invariants of
the bcache.  Any time you get a psymbol from the bcache, it is going
to have other fields that were not hashed somewhat random.  What are
those ignored fields, and why do they not matter?  How about
lifetimes, are they as long-lived as the bcache?

You compare name, value, language, domain, and class.  The mangled
name is ignored; this assumes that there is only ever one mangled name
per demangled name, with no documentation of why that's safe to
assume.  Section is ignored; if there are two definitions of a symbol
with the same name in different sections but the same value otherwise,
we'll never find out.  That could break overlays.

-- 
Daniel Jacobowitz
CodeSourcery


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