From: Daniel Jacobowitz <drow@mvista.com>
To: Elena Zannoni <ezannoni@cygnus.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [rfa] symbol hashing, part 1/n - updates to hash functions
Date: Fri, 12 Oct 2001 12:09:00 -0000 [thread overview]
Message-ID: <20011012150818.C16180@nevyn.them.org> (raw)
In-Reply-To: <15303.5384.908325.196958@krustylu.cygnus.com>
On Fri, Oct 12, 2001 at 12:06:32PM -0400, Elena Zannoni wrote:
> Just hold on the '%' move until the next patch.
> Everything else is fine.
OK, I've committed the attached.
--
Daniel Jacobowitz Carnegie Mellon University
MontaVista Software Debian GNU/Linux Developer
2001-10-12 Daniel Jacobowitz <drow@mvista.com>
* minsyms.c (msymbol_hash): Use better hash function.
(msymbol_hash_iw): Likewise. Terminate loop at '(' properly.
* objfiles.h: Increase MINIMAL_SYMBOL_HASH_SIZE to match modern
binaries.
Index: gdb/minsyms.c
===================================================================
RCS file: /cvs/src/src/gdb/minsyms.c,v
retrieving revision 1.17
diff -u -r1.17 minsyms.c
--- minsyms.c 2001/05/29 10:45:10 1.17
+++ minsyms.c 2001/10/12 19:02:55
@@ -96,8 +96,10 @@
while (isspace (*string))
++string;
if (*string && *string != '(')
- hash = (31 * hash) + *string;
- ++string;
+ {
+ hash = hash * 67 + *string - 113;
+ ++string;
+ }
}
return hash % MINIMAL_SYMBOL_HASH_SIZE;
}
@@ -109,7 +111,7 @@
{
unsigned int hash = 0;
for (; *string; ++string)
- hash = (31 * hash) + *string;
+ hash = hash * 67 + *string - 113;
return hash % MINIMAL_SYMBOL_HASH_SIZE;
}
Index: gdb/objfiles.h
===================================================================
RCS file: /cvs/src/src/gdb/objfiles.h,v
retrieving revision 1.8
diff -u -r1.8 objfiles.h
--- objfiles.h 2001/03/06 08:21:11 1.8
+++ objfiles.h 2001/10/12 19:02:55
@@ -202,7 +202,7 @@
extern void print_symbol_bcache_statistics (void);
/* Number of entries in the minimal symbol hash table. */
-#define MINIMAL_SYMBOL_HASH_SIZE 349
+#define MINIMAL_SYMBOL_HASH_SIZE 2039
/* Master structure for keeping track of each file from which
gdb reads symbols. There are several ways these get allocated: 1.
next prev parent reply other threads:[~2001-10-12 12:09 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-10-09 7:57 Daniel Jacobowitz
2001-10-11 16:51 ` Elena Zannoni
2001-10-11 16:58 ` Daniel Berlin
2001-10-12 8:54 ` Elena Zannoni
2001-10-11 17:01 ` Daniel Jacobowitz
2001-10-12 8:59 ` Elena Zannoni
2001-10-12 12:09 ` Daniel Jacobowitz [this message]
2001-10-12 15:34 ` Elena Zannoni
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20011012150818.C16180@nevyn.them.org \
--to=drow@mvista.com \
--cc=ezannoni@cygnus.com \
--cc=gdb-patches@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox