Skip to content
This repository has been archived by the owner on Nov 1, 2024. It is now read-only.

Commit

Permalink
fix Unnecessary SymList Copy
Browse files Browse the repository at this point in the history
  • Loading branch information
KawaiiNahida committed Dec 15, 2021
1 parent dd2151b commit 0cd08b7
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions Chakra/SymDB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,13 +218,12 @@ CRITICAL_SECTION dlsymLock;
void InitFastDlsym() {
fmt::print(fmt::format("[{:%H:%M:%S} Info][SymDB] Loading Symbols\n", fmt::localtime(_time64(0))));
InitializeCriticalSection(&dlsymLock);
unordered_map<string, int, aphash> *realFuncMap = new unordered_map<string, int, aphash>;
SymDB->dumpall(realFuncMap);
FuncMap = new unordered_map<string, int, aphash>;
SymDB->dumpall(FuncMap);
fnstat = 1;
SymDB = nullptr;
SymDB = new SymDBReader("bedrock_server.symdb2");
EnterCriticalSection(&dlsymLock);
FuncMap = realFuncMap;
void* exportTableFn = GetProcAddress(GetModuleHandle(nullptr), "?initializeLogging@DedicatedServer@@AEAAXXZ");
void* symdbFn = 0;
auto iter = FuncMap->find(string("?initializeLogging@DedicatedServer@@AEAAXXZ"));
Expand All @@ -238,7 +237,7 @@ void InitFastDlsym() {
//fmt::print(fmt::format("[{:%Y-%m-%d %H:%M:%S} Info] Are you running bedrock_serve_mod.exe?\n", fmt::localtime(_time64(0))));
}
LeaveCriticalSection(&dlsymLock);
fmt::print(fmt::format("[{:%H:%M:%S} Info][SymDB] FastDlsymInited <{}>\n", fmt::localtime(_time64(0)), realFuncMap->size()));
fmt::print(fmt::format("[{:%H:%M:%S} Info][SymDB] FastDlsymInited <{}>\n", fmt::localtime(_time64(0)), FuncMap->size()));
fflush(stdout);
}

Expand Down

0 comments on commit 0cd08b7

Please sign in to comment.