1
0
Fork 0

DBG: Conserve memory when copying BBlock vectors

This commit is contained in:
Nukem 2015-06-30 23:35:59 -04:00
parent c98c82203a
commit 47f3923464
1 changed files with 6 additions and 1 deletions

View File

@ -57,7 +57,12 @@ bool LinearPass::Analyse()
m_MainBlocks.clear(); m_MainBlocks.clear();
for(uint i = 0; i < m_MaximumThreads; i++) for(uint i = 0; i < m_MaximumThreads; i++)
m_MainBlocks.insert(m_MainBlocks.end(), threadBlocks[i].begin(), threadBlocks[i].end()); {
std::move(threadBlocks[i].begin(), threadBlocks[i].end(), std::back_inserter(m_MainBlocks));
// Free vector elements to conserve memory further
BBlockArray().swap(threadBlocks[i]);
}
// Sort and remove duplicates // Sort and remove duplicates
std::sort(m_MainBlocks.begin(), m_MainBlocks.end()); std::sort(m_MainBlocks.begin(), m_MainBlocks.end());