mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-25 15:34:36 +00:00
Indicate that memory limit was hit with notification triangle color.
This commit is contained in:
parent
89f1fb4825
commit
68473381b9
@ -998,14 +998,22 @@ bool View::DrawImpl()
|
||||
if( dx < targetLabelSize ) ImGui::SameLine( cx + targetLabelSize );
|
||||
ImGui::Spacing();
|
||||
|
||||
if( m_worker.GetMemoryLimit() > 0 )
|
||||
const auto memoryLimit = m_worker.GetMemoryLimit();
|
||||
if( memoryLimit > 0 )
|
||||
{
|
||||
ImGui::SameLine();
|
||||
TextColoredUnformatted( 0xFF00FFFF, ICON_FA_TRIANGLE_EXCLAMATION );
|
||||
if( memUsage.load( std::memory_order_relaxed ) > memoryLimit )
|
||||
{
|
||||
TextColoredUnformatted( 0xFF2222FF, ICON_FA_TRIANGLE_EXCLAMATION );
|
||||
}
|
||||
else
|
||||
{
|
||||
TextColoredUnformatted( 0xFF00FFFF, ICON_FA_TRIANGLE_EXCLAMATION );
|
||||
}
|
||||
if( ImGui::IsItemHovered() )
|
||||
{
|
||||
ImGui::BeginTooltip();
|
||||
ImGui::Text( "Memory limit: %s", MemSizeToString( m_worker.GetMemoryLimit() ) );
|
||||
ImGui::Text( "Memory limit: %s", MemSizeToString( memoryLimit ) );
|
||||
ImGui::EndTooltip();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user