crlib: reworked dictionary to hashmap.
linkage: another fix to dynamic linkage. cpp: fixed msvc warning about placement new.
This commit is contained in:
parent
b70d2af4ab
commit
43f6a7828a
12 changed files with 291 additions and 312 deletions
15
inc/engine.h
15
inc/engine.h
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue