mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-10 02:31:48 +00:00
The underlying vector might be reallocated.
This commit is contained in:
parent
6cfd53b274
commit
428b7da1cc
@ -7573,7 +7573,7 @@ void View::DrawFrameTreeLevel( std::vector<CallstackFrameTree>& tree, int& idx )
|
||||
{
|
||||
if( v.callstacks.find( mem[i].csAlloc ) != v.callstacks.end() )
|
||||
{
|
||||
m_memInfo.allocList.emplace_back( mem.data() + i );
|
||||
m_memInfo.allocList.emplace_back( i );
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -7670,9 +7670,17 @@ void View::DrawFrameTreeLevel( std::vector<CallstackFrameTree>& tree, int& idx )
|
||||
|
||||
void View::DrawAllocList()
|
||||
{
|
||||
std::vector<const MemEvent*> data;
|
||||
auto basePtr = m_worker.GetMemData().data.data();
|
||||
data.reserve( m_memInfo.allocList.size() );
|
||||
for( auto& idx : m_memInfo.allocList )
|
||||
{
|
||||
data.emplace_back( basePtr + idx );
|
||||
}
|
||||
|
||||
ImGui::Begin( "Allocations list", &m_memInfo.showAllocList );
|
||||
TextFocused( "Number of allocations:", RealToString( m_memInfo.allocList.size(), true ) );
|
||||
ListMemData<decltype( m_memInfo.allocList.begin() )>( m_memInfo.allocList.begin(), m_memInfo.allocList.end(), [this]( auto& v ) {
|
||||
ListMemData<decltype( data.begin() )>( data.begin(), data.end(), [this]( auto& v ) {
|
||||
ImGui::Text( "0x%" PRIx64, (*v)->ptr );
|
||||
}, "##allocations" );
|
||||
ImGui::End();
|
||||
|
@ -404,7 +404,7 @@ private:
|
||||
uint64_t ptrFind = 0;
|
||||
bool restrictTime = false;
|
||||
bool showAllocList = false;
|
||||
std::vector<const MemEvent*> allocList;
|
||||
std::vector<size_t> allocList;
|
||||
} m_memInfo;
|
||||
|
||||
struct {
|
||||
|
Loading…
Reference in New Issue
Block a user