mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-09-23 22:25:55 +00:00
Fix display of live chunk count
This commit is contained in:
@@ -33,7 +33,6 @@
|
||||
|
||||
int64_t Chunk::m_LiveChunks = 0;
|
||||
int64_t Chunk::m_TotalMem = 0;
|
||||
int64_t Chunk::m_MaxChunks = 0;
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1718,7 +1718,16 @@ class ScopedChunk;
|
||||
class Chunk
|
||||
{
|
||||
public:
|
||||
~Chunk() { FreeAlignedBuffer(m_Data); }
|
||||
~Chunk()
|
||||
{
|
||||
FreeAlignedBuffer(m_Data);
|
||||
|
||||
#if !defined(RELEASE)
|
||||
Atomic::Dec64(&m_LiveChunks);
|
||||
Atomic::ExchAdd64(&m_TotalMem, -int64_t(m_Length));
|
||||
#endif
|
||||
}
|
||||
|
||||
template <typename ChunkType>
|
||||
ChunkType GetChunkType()
|
||||
{
|
||||
@@ -1746,6 +1755,11 @@ public:
|
||||
memcpy(m_Data, ser.GetWriter()->GetData(), (size_t)m_Length);
|
||||
|
||||
ser.GetWriter()->Rewind();
|
||||
|
||||
#if !defined(RELEASE)
|
||||
Atomic::Inc64(&m_LiveChunks);
|
||||
Atomic::ExchAdd64(&m_TotalMem, int64_t(m_Length));
|
||||
#endif
|
||||
}
|
||||
|
||||
byte *GetData() const { return m_Data; }
|
||||
@@ -1759,6 +1773,11 @@ public:
|
||||
|
||||
memcpy(ret->m_Data, m_Data, (size_t)m_Length);
|
||||
|
||||
#if !defined(RELEASE)
|
||||
Atomic::Inc64(&m_LiveChunks);
|
||||
Atomic::ExchAdd64(&m_TotalMem, int64_t(m_Length));
|
||||
#endif
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -1780,7 +1799,7 @@ private:
|
||||
byte *m_Data;
|
||||
|
||||
#if !defined(RELEASE)
|
||||
static int64_t m_LiveChunks, m_MaxChunks, m_TotalMem;
|
||||
static int64_t m_LiveChunks, m_TotalMem;
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user