Keep chunk count valid with duplicated chunks

This commit is contained in:
baldurk
2016-09-08 15:50:36 +02:00
parent 668e445778
commit 726425ee88
+13
View File
@@ -295,6 +295,19 @@ Chunk *Chunk::Duplicate()
memcpy(ret->m_Data, m_Data, m_Length);
#if !defined(RELEASE)
int64_t newval = Atomic::Inc64(&m_LiveChunks);
Atomic::ExchAdd64(&m_TotalMem, m_Length);
if(newval > m_MaxChunks)
{
int breakpointme = 0;
(void)breakpointme;
}
m_MaxChunks = RDCMAX(newval, m_MaxChunks);
#endif
return ret;
}