diff options
author | Simon Marchi <simon.marchi@efficios.com> | 2022-10-20 12:48:27 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@polymtl.ca> | 2023-01-05 14:38:51 -0500 |
commit | 72127b193c970a61a36c940bf167c596ddc32eae (patch) | |
tree | 81e44a942d180d2596995406382c1a9a0e94a01e /gdb/utils.h | |
parent | 8b35ed1febd786c7aec34bbd7080c73a7c91bfca (diff) | |
download | gdb-72127b193c970a61a36c940bf167c596ddc32eae.zip gdb-72127b193c970a61a36c940bf167c596ddc32eae.tar.gz gdb-72127b193c970a61a36c940bf167c596ddc32eae.tar.bz2 |
gdbsupport: move fast_hash to gdbsupport/common-utils.h
The following patch adds a hash type for gdb::string_view in gdbsupport,
which will use the fast_hash function. Move the latter to gdbsupport.
Change-Id: Id74510e17801e775bd5ffa5f443713d79adf14ad
Approved-By: Andrew Burgess <aburgess@redhat.com>
Diffstat (limited to 'gdb/utils.h')
-rw-r--r-- | gdb/utils.h | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/gdb/utils.h b/gdb/utils.h index 59cab93..7865812 100644 --- a/gdb/utils.h +++ b/gdb/utils.h @@ -26,10 +26,6 @@ #include "gdbsupport/scoped_restore.h" #include <chrono> -#ifdef HAVE_LIBXXHASH -#include <xxhash.h> -#endif - struct completion_match_for_lcd; class compiled_regex; @@ -348,19 +344,4 @@ 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 data in a fast way - when the length is known. If no fast hashing library is available, falls - 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 void *ptr, size_t len, unsigned int start_value = 0) -{ -#ifdef HAVE_LIBXXHASH - return XXH64 (ptr, len, start_value); -#else - return iterative_hash (ptr, len, start_value); -#endif -} - #endif /* UTILS_H */ |