mirror of
https://github.com/wolfpld/tracy.git
synced 2026-06-08 00:23:47 +00:00
Store annotation pointers as shared_ptr.
This commit is contained in:
@@ -174,7 +174,7 @@ void UserData::StateShouldBePreserved()
|
||||
m_preserveState = true;
|
||||
}
|
||||
|
||||
void UserData::LoadAnnotations( std::vector<std::unique_ptr<Annotation>>& data )
|
||||
void UserData::LoadAnnotations( std::vector<std::shared_ptr<Annotation>>& data )
|
||||
{
|
||||
assert( Valid() );
|
||||
FILE* f = OpenFile( FileAnnotations, false );
|
||||
@@ -211,7 +211,7 @@ void UserData::LoadAnnotations( std::vector<std::unique_ptr<Annotation>>& data )
|
||||
}
|
||||
}
|
||||
|
||||
void UserData::StoreAnnotations( const std::vector<std::unique_ptr<Annotation>>& data )
|
||||
void UserData::StoreAnnotations( const std::vector<std::shared_ptr<Annotation>>& data )
|
||||
{
|
||||
if( !m_preserveState ) return;
|
||||
if( data.empty() )
|
||||
|
||||
@@ -30,8 +30,8 @@ public:
|
||||
void StoreState( const ViewData& data );
|
||||
void StateShouldBePreserved();
|
||||
|
||||
void LoadAnnotations( std::vector<std::unique_ptr<Annotation>>& data );
|
||||
void StoreAnnotations( const std::vector<std::unique_ptr<Annotation>>& data );
|
||||
void LoadAnnotations( std::vector<std::shared_ptr<Annotation>>& data );
|
||||
void StoreAnnotations( const std::vector<std::shared_ptr<Annotation>>& data );
|
||||
|
||||
void LoadSourceSubstitutions( std::vector<SourceRegex>& data );
|
||||
void StoreSourceSubstitutions( const std::vector<SourceRegex>& data );
|
||||
|
||||
@@ -680,7 +680,7 @@ private:
|
||||
FrameImageCache m_FrameTextureCache;
|
||||
FrameImageCache m_FrameTextureCacheConnection;
|
||||
|
||||
std::vector<std::unique_ptr<Annotation>> m_annotations;
|
||||
std::vector<std::shared_ptr<Annotation>> m_annotations;
|
||||
UserData m_userData;
|
||||
|
||||
alignas(64) std::atomic<bool> m_wasActive { false };
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace tracy
|
||||
|
||||
void View::AddAnnotation( int64_t start, int64_t end )
|
||||
{
|
||||
auto ann = std::make_unique<Annotation>();
|
||||
auto ann = std::make_shared<Annotation>();
|
||||
ann->range.active = true;
|
||||
ann->range.min = start;
|
||||
ann->range.max = end;
|
||||
|
||||
Reference in New Issue
Block a user