crlib: reworked dictionary to hashmap.

linkage: another fix to dynamic linkage.
cpp: fixed msvc warning about placement new.
This commit is contained in:
dmitry 2020-06-15 22:36:11 +03:00 committed by jeefo
commit 43f6a7828a
12 changed files with 291 additions and 312 deletions

View file

@ -628,23 +628,10 @@ private:
# define HOOK_CAST SharedLibrary::Handle
#endif
private:
template <typename K> struct CharHash {
uint32 operator () (const char *key) const {
auto str = const_cast <char *> (key);
uint32 hash = 0;
while (*str++) {
hash = ((hash << 5) + hash) + *str;
}
return hash;
}
};
private:
SharedLibrary m_self;
SimpleHook m_dlsym;
Dictionary <const char *, SharedLibrary::Handle, CharHash <const char *>> m_exports;
HashMap <StringRef, SharedLibrary::Handle> m_exports;
public:
EntityLinkage () = default;