diff --git a/src/__stl__.h b/src/__stl__.h index a513f1f1..c0344c88 100644 --- a/src/__stl__.h +++ b/src/__stl__.h @@ -23,6 +23,9 @@ #include #include +#define EMH_WYHASH_HASH 1 +#include "hash_table8.hpp" + #ifdef POCKETPY_H #define UNREACHABLE() throw std::runtime_error( "L" + std::to_string(__LINE__) + " UNREACHABLE()! This should be a bug, please report it"); #else diff --git a/src/hash_table8.hpp b/src/hash_table8.hpp index 5ab48c6c..cd3556ea 100644 --- a/src/hash_table8.hpp +++ b/src/hash_table8.hpp @@ -1660,7 +1660,7 @@ one-way search strategy. #if EMH_WYHASH_HASH //#define WYHASH_CONDOM 1 - inline uint64_t wymix(uint64_t A, uint64_t B) + inline static uint64_t wymix(uint64_t A, uint64_t B) { #if defined(__SIZEOF_INT128__) __uint128_t r = A; r *= B; diff --git a/src/main.cpp b/src/main.cpp index cde1830c..bd292e06 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3,8 +3,8 @@ #include "pocketpy.h" -//#define PK_DEBUG_TIME -#define PK_DEBUG_THREADED +#define PK_DEBUG_TIME +//#define PK_DEBUG_THREADED struct Timer{ const char* title; diff --git a/src/safestl.h b/src/safestl.h index 5f50cf30..8a04472e 100644 --- a/src/safestl.h +++ b/src/safestl.h @@ -36,8 +36,6 @@ public: }; -#include "hash_table8.hpp" - class PyVarDict: public emhash8::HashMap<_Str, PyVar> { using emhash8::HashMap<_Str, PyVar>::HashMap; }; diff --git a/src/str.h b/src/str.h index e77574ae..b1f33780 100644 --- a/src/str.h +++ b/src/str.h @@ -46,7 +46,8 @@ public: size_t hash() const{ if(!hash_initialized){ - _hash = std::hash()(*this); + //_hash = std::hash()(*this); + _hash = emhash8::HashMap::wyhashstr(data(), size()); hash_initialized = true; } return _hash;