Use small vector.

This commit is contained in:
Bartosz Taudul 2017-09-15 20:17:39 +02:00
parent 6b589e9479
commit b4faa0a9b9
3 changed files with 6 additions and 5 deletions

View File

@ -1,7 +1,7 @@
#ifndef __TRACYEVENT_HPP__
#define __TRACYEVENT_HPP__
#include <vector>
#include "TracyVector.hpp"
namespace tracy
{
@ -11,7 +11,7 @@ struct Event
int64_t start;
int64_t end;
std::vector<Event*> child;
Vector<Event*> child;
};
enum { EventSize = sizeof( Event ) };

View File

@ -242,7 +242,7 @@ void View::NewZone( Event* zone )
const auto lastend = m_timeline.back()->end;
if( lastend != -1 && lastend < zone->start )
{
m_timeline.emplace_back( zone );
m_timeline.push_back( zone );
}
else
{
@ -251,7 +251,7 @@ void View::NewZone( Event* zone )
}
else
{
m_timeline.emplace_back( zone );
m_timeline.push_back( zone );
}
}

View File

@ -13,6 +13,7 @@
#include "../common/TracyQueue.hpp"
#include "TracyEvent.hpp"
#include "TracySlab.hpp"
#include "TracyVector.hpp"
namespace tracy
{
@ -58,7 +59,7 @@ private:
// this block must be locked
std::mutex m_lock;
std::vector<float> m_mbps;
std::vector<Event*> m_timeline;
Vector<Event*> m_timeline;
std::unordered_map<uint64_t, std::string> m_strings;
// not used for vis - no need to lock