1
0
mirror of https://github.com/wolfpld/tracy synced 2025-04-29 12:23:53 +00:00

DrawAllocList() is memory.

This commit is contained in:
Bartosz Taudul 2022-07-02 15:24:59 +02:00
parent c2728fde04
commit 5ed7d71927
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3
2 changed files with 22 additions and 22 deletions

View File

@ -3749,28 +3749,6 @@ void View::DrawRangeEntry( Range& range, const char* label, uint32_t color, cons
}
}
void View::DrawAllocList()
{
const auto scale = GetScale();
ImGui::SetNextWindowSize( ImVec2( 1100 * scale, 500 * scale ), ImGuiCond_FirstUseEver );
ImGui::Begin( "Allocations list", &m_memInfo.showAllocList );
if( ImGui::GetCurrentWindowRead()->SkipItems ) { ImGui::End(); return; }
std::vector<const MemEvent*> data;
auto basePtr = m_worker.GetMemoryNamed( m_memInfo.pool ).data.data();
data.reserve( m_memInfo.allocList.size() );
for( auto& idx : m_memInfo.allocList )
{
data.emplace_back( basePtr + idx );
}
TextFocused( "Number of allocations:", RealToString( m_memInfo.allocList.size() ) );
ListMemData( data, []( auto v ) {
ImGui::Text( "0x%" PRIx64, v->Ptr() );
}, "##allocations", -1, m_memInfo.pool );
ImGui::End();
}
void View::CrashTooltip()
{
auto& crash = m_worker.GetCrashEvent();

View File

@ -897,4 +897,26 @@ void View::ListMemData( std::vector<const MemEvent*>& vec, std::function<void(co
}
}
void View::DrawAllocList()
{
const auto scale = GetScale();
ImGui::SetNextWindowSize( ImVec2( 1100 * scale, 500 * scale ), ImGuiCond_FirstUseEver );
ImGui::Begin( "Allocations list", &m_memInfo.showAllocList );
if( ImGui::GetCurrentWindowRead()->SkipItems ) { ImGui::End(); return; }
std::vector<const MemEvent*> data;
auto basePtr = m_worker.GetMemoryNamed( m_memInfo.pool ).data.data();
data.reserve( m_memInfo.allocList.size() );
for( auto& idx : m_memInfo.allocList )
{
data.emplace_back( basePtr + idx );
}
TextFocused( "Number of allocations:", RealToString( m_memInfo.allocList.size() ) );
ListMemData( data, []( auto v ) {
ImGui::Text( "0x%" PRIx64, v->Ptr() );
}, "##allocations", -1, m_memInfo.pool );
ImGui::End();
}
}