diff options
Diffstat (limited to 'src/support')
-rw-r--r-- | src/support/hash.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/support/hash.h b/src/support/hash.h index e2d393d25..5ee3b8a3d 100644 --- a/src/support/hash.h +++ b/src/support/hash.h @@ -17,6 +17,7 @@ #ifndef wasm_support_hash_h #define wasm_support_hash_h +#include <functional> #include <stdint.h> namespace wasm { @@ -34,6 +35,10 @@ inline uint32_t rehash(uint32_t x, uint32_t y) { // see http://www.cse.yorku.ca/ return hash; } +inline size_t rehash(uint64_t x, uint64_t y) { // see boost and https://stackoverflow.com/a/2595226/1176841 + return x ^ (y + 0x9e3779b9 + (x << 6) + (x >> 2)); +} + } // namespace wasm #endif // wasm_support_hash_h |