1
0
Fork 0

DBG: Small memory optimization in AnalysisPass

This commit is contained in:
Nukem 2016-02-14 18:44:15 -05:00
parent 255a139bcf
commit e2ce073c8a
1 changed files with 3 additions and 3 deletions

View File

@ -14,11 +14,11 @@ AnalysisPass::AnalysisPass(duint VirtualStart, duint VirtualEnd, BBlockArray & M
// Read remote instruction data to local memory
m_DataSize = VirtualEnd - VirtualStart;
m_Data = (unsigned char*)emalloc(m_DataSize, "AnalysisPass:m_Data");
m_Data = (unsigned char*)VirtualAlloc(nullptr, m_DataSize, MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE);
if(!MemRead(VirtualStart, m_Data, m_DataSize))
{
BridgeFree(m_Data);
VirtualFree(m_Data, 0, MEM_RELEASE);
assert(false);
}
}
@ -26,7 +26,7 @@ AnalysisPass::AnalysisPass(duint VirtualStart, duint VirtualEnd, BBlockArray & M
AnalysisPass::~AnalysisPass()
{
if(m_Data)
efree(m_Data);
VirtualFree(m_Data, 0, MEM_RELEASE);
}
BasicBlock* AnalysisPass::FindBBlockInRange(duint Address)