[RFC] Use custom hash function with bcache

Daniel Jacobowitz dan@codesourcery.com
Mon Aug 16 20:49:00 GMT 2010


On Mon, Aug 16, 2010 at 04:11:01PM -0400, sami wagiaalla wrote:
> On 08/16/2010 04:03 PM, Daniel Jacobowitz wrote:
> >On Mon, Aug 16, 2010 at 03:50:17PM -0400, sami wagiaalla wrote:
> >>I only took into consideration the values which are set by
> >>add_psymbol_to_bcache. The assumption is that these are the only
> >>values that will make a difference since they are the only values
> >>available when calculating the hash.
> >
> >Interesting, I didn't remember about add_psymbol_to_bcache.  I'd
> >better back up - what are you accomplishing by this change?
> >
> 
> A previous patch of mine introduced a bcache regression :D. The patch
> made cplus_specifc a pointer to an allocated struct. This is because
> we wanted to store more information in cplus_specific without
> penalizing the other other languages. With cplus_specific being a
> pointer hashing the whole symbol didn't work anymore. This patch is
> an attempt to fix that.

Aha!  OK, I get it now.  And the section is probably never used for
psymbols, right?

I think that the way you've got this is probably OK, but could stand
some more explanation.  It kind of pains me, though, because there's
an obvious missed optimization that I don't see how to do efficiently.
We don't need to do the work of SYMBOL_SET_NAMES again if there's already a
named version in the cache...

-- 
Daniel Jacobowitz
CodeSourcery



More information about the Gdb-patches mailing list