DBG: Conserve memory when copying BBlock vectors
This commit is contained in:
parent
c98c82203a
commit
47f3923464
|
@ -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());
|
||||||
|
|
Loading…
Reference in New Issue