aboutsummaryrefslogtreecommitdiff
path: root/gdb/utils.h
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/utils.h')
-rw-r--r--gdb/utils.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/gdb/utils.h b/gdb/utils.h
index 79c8a6f..c8337f2 100644
--- a/gdb/utils.h
+++ b/gdb/utils.h
@@ -571,17 +571,18 @@ extern void copy_bitwise (gdb_byte *dest, ULONGEST dest_offset,
const gdb_byte *source, ULONGEST source_offset,
ULONGEST nbits, int bits_big_endian);
-/* A fast hashing function. This can be used to hash strings in a fast way
+/* A fast hashing function. This can be used to hash data in a fast way
when the length is known. If no fast hashing library is available, falls
- back to iterative_hash from libiberty. */
+ back to iterative_hash from libiberty. START_VALUE can be set to
+ continue hashing from a previous value. */
static inline unsigned int
-fast_hash (const char* str, size_t len)
+fast_hash (const void *ptr, size_t len, unsigned int start_value = 0)
{
#ifdef HAVE_LIBXXHASH
- return XXH64 (str, len, 0);
+ return XXH64 (ptr, len, start_value);
#else
- return iterative_hash (str, len, 0);
+ return iterative_hash (ptr, len, start_value);
#endif
}