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

@ -1161,21 +1161,21 @@ SharedLibrary::Handle EntityLinkage::lookup (SharedLibrary::Handle module, const
if (self.handle () != module) {
return resolve (module);
}
if (m_exports.has (function)) {
return m_exports[function];
}
auto botAddr = resolve (self.handle ());
if (!botAddr) {
auto gameAddr = resolve (gamedll.handle ());
if (gameAddr) {
m_exports[function] = gameAddr;
return m_exports[function] = gameAddr;
}
}
else {
m_exports[function] = botAddr;
}
if (m_exports.exists (function)) {
return m_exports[function];
return m_exports[function] = botAddr;
}
return nullptr;
}