aboutsummaryrefslogtreecommitdiff
path: root/gdb/symtab.c
diff options
context:
space:
mode:
authorChristian Biesinger <cbiesinger@google.com>2019-09-27 13:08:25 -0500
committerChristian Biesinger <cbiesinger@google.com>2019-10-22 11:26:17 -0500
commit1a6ff1a96b302283d517b3cdeae7310adecbe859 (patch)
tree0865c6916b3f41de3c77f11505cef808501150cd /gdb/symtab.c
parent7bb43059820c5febb4509b15202a93efde442bc6 (diff)
downloadfsf-binutils-gdb-1a6ff1a96b302283d517b3cdeae7310adecbe859.zip
fsf-binutils-gdb-1a6ff1a96b302283d517b3cdeae7310adecbe859.tar.gz
fsf-binutils-gdb-1a6ff1a96b302283d517b3cdeae7310adecbe859.tar.bz2
Add a fast_hash function in common-utils
Also updates a caller in symtab.c. For now this just calls htab_hash_string but the next patch will change it to xxhash, if available. gdb/ChangeLog: 2019-10-22 Christian Biesinger <cbiesinger@google.com> * utils.h (fast_hash): New function. * symtab.c (hash_demangled_name_entry): Call new function fast_hash. Change-Id: I77cac0d9aa78fc65316a2af449f52edcae72dc9b
Diffstat (limited to 'gdb/symtab.c')
-rw-r--r--gdb/symtab.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gdb/symtab.c b/gdb/symtab.c
index 567d09d..dff92ca 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -70,6 +70,7 @@
#include <algorithm>
#include "gdbsupport/gdb_string_view.h"
#include "gdbsupport/pathstuff.h"
+#include "gdbsupport/common-utils.h"
/* Forward declarations for local functions. */
@@ -727,7 +728,7 @@ hash_demangled_name_entry (const void *data)
const struct demangled_name_entry *e
= (const struct demangled_name_entry *) data;
- return iterative_hash (e->mangled.data (), e->mangled.length (), 0);
+ return fast_hash (e->mangled.data (), e->mangled.length ());
}
/* Equality function for the demangled name hash. */