@@ -117,6 +117,7 @@ class Serialiser
117
117
Serialiser (const Serialiser &other) = delete ;
118
118
119
119
bool IsErrored () { return IsReading () ? m_Read->IsErrored () : m_Write->IsErrored (); }
120
+ bool IsDummy () { return m_Dummy; }
120
121
StreamWriter *GetWriter () { return m_Write; }
121
122
StreamReader *GetReader () { return m_Read; }
122
123
uint32_t GetChunkMetadataRecording () { return m_ChunkFlags; }
@@ -299,7 +300,7 @@ class Serialiser
299
300
// ScopedDeseralise* classes. We can verify with e.g. valgrind that there are no leaks, so to keep
300
301
// the analysis non-spammy we just don't allocate for coverity builds
301
302
#if !defined(__COVERITY__)
302
- if (flags & SerialiserFlags::AllocateMemory)
303
+ if (!m_Dummy && ( flags & SerialiserFlags::AllocateMemory) )
303
304
{
304
305
if (byteSize > 0 )
305
306
el = AllocAlignedBuffer (byteSize);
@@ -702,7 +703,7 @@ class Serialiser
702
703
// ScopedDeseralise* classes. We can verify with e.g. valgrind that there are no leaks, so to keep
703
704
// the analysis non-spammy we just don't allocate for coverity builds
704
705
#if !defined(__COVERITY__)
705
- if (IsReading () && (flags & SerialiserFlags::AllocateMemory))
706
+ if (IsReading () && !m_Dummy && (flags & SerialiserFlags::AllocateMemory))
706
707
{
707
708
if (arrayCount > 0 )
708
709
el = new T[(size_t )arrayCount];
@@ -737,7 +738,7 @@ class Serialiser
737
738
// ScopedDeseralise* classes. We can verify with e.g. valgrind that there are no leaks, so to keep
738
739
// the analysis non-spammy we just don't allocate for coverity builds
739
740
#if !defined(__COVERITY__)
740
- if (IsReading () && (flags & SerialiserFlags::AllocateMemory))
741
+ if (IsReading () && !m_Dummy && (flags & SerialiserFlags::AllocateMemory))
741
742
{
742
743
if (arrayCount > 0 )
743
744
el = new T[(size_t )arrayCount];
@@ -1487,6 +1488,7 @@ class Serialiser
1487
1488
Serialiser (StreamWriter *writer, Ownership own);
1488
1489
Serialiser (StreamReader *reader, Ownership own, SDObject *rootStructuredObj);
1489
1490
1491
+ void SetDummy (bool dummy) { m_Dummy = dummy; }
1490
1492
private:
1491
1493
static const uint64_t ChunkAlignment = 64 ;
1492
1494
template <class SerialiserMode , typename T, bool isEnum = std::is_enum<T>::value>
@@ -1550,6 +1552,7 @@ class Serialiser
1550
1552
// See SetStreamingMode
1551
1553
bool m_DataStreaming = false ;
1552
1554
bool m_DrawChunk = false ;
1555
+ bool m_Dummy = false ;
1553
1556
1554
1557
uint64_t m_LastChunkOffset = 0 ;
1555
1558
uint64_t m_ChunkFixup = 0 ;
@@ -1617,6 +1620,7 @@ class StructuredSerialiser : public Serialiser<SerialiserMode::Reading>
1617
1620
{
1618
1621
ConfigureStructuredExport (lookup, false );
1619
1622
SetStreamingMode (true );
1623
+ SetDummy (true );
1620
1624
}
1621
1625
};
1622
1626
#endif
0 commit comments