Use short ptr for message data.

This commit is contained in:
Bartosz Taudul 2019-11-02 16:32:42 +01:00
parent 52062f96d0
commit 72efbe28ed
2 changed files with 3 additions and 3 deletions

View File

@ -5506,7 +5506,7 @@ void Worker::Write( FileWrite& f )
f.Write( &sz, sizeof( sz ) );
for( auto& v : m_data.messages )
{
const auto ptr = (uint64_t)v;
const auto ptr = (uint64_t)(MessageData*)v;
f.Write( &ptr, sizeof( ptr ) );
WriteTimeOffset( f, refTime, v->time );
f.Write( &v->ref, sizeof( v->ref ) );

View File

@ -161,7 +161,7 @@ private:
StringDiscovery<FrameData*> frames;
FrameData* framesBase;
Vector<GpuCtxData*> gpuData;
Vector<MessageData*> messages;
Vector<short_ptr<MessageData>> messages;
StringDiscovery<PlotData*> plots;
Vector<ThreadData*> threads;
MemData memory;
@ -326,7 +326,7 @@ public:
std::pair<int, int> GetFrameRange( const FrameData& fd, int64_t from, int64_t to );
const flat_hash_map<uint32_t, LockMap*, nohash<uint32_t>>& GetLockMap() const { return m_data.lockMap; }
const Vector<MessageData*>& GetMessages() const { return m_data.messages; }
const Vector<short_ptr<MessageData>>& GetMessages() const { return m_data.messages; }
const Vector<GpuCtxData*>& GetGpuData() const { return m_data.gpuData; }
const Vector<PlotData*>& GetPlots() const { return m_data.plots.Data(); }
const Vector<ThreadData*>& GetThreadData() const { return m_data.threads; }