mirror of
https://github.com/wolfpld/tracy
synced 2025-04-29 12:23:53 +00:00
Merge pull request #724 from idbrii/fix-mem-callstacktree-active
Memory: correctly filter active allocations in call stack tree
This commit is contained in:
commit
5ce238e9b4
@ -58,6 +58,8 @@ unordered_flat_map<uint32_t, View::MemPathData> View::GetCallstackPaths( const M
|
|||||||
unordered_flat_map<uint32_t, MemPathData> pathSum;
|
unordered_flat_map<uint32_t, MemPathData> pathSum;
|
||||||
pathSum.reserve( m_worker.GetCallstackPayloadCount() );
|
pathSum.reserve( m_worker.GetCallstackPayloadCount() );
|
||||||
|
|
||||||
|
const bool hide_inactive = memRange == MemRange::Active;
|
||||||
|
|
||||||
if( m_memInfo.range.active )
|
if( m_memInfo.range.active )
|
||||||
{
|
{
|
||||||
auto it = std::lower_bound( mem.data.begin(), mem.data.end(), m_memInfo.range.min, []( const auto& lhs, const auto& rhs ) { return lhs.TimeAlloc() < rhs; } );
|
auto it = std::lower_bound( mem.data.begin(), mem.data.end(), m_memInfo.range.min, []( const auto& lhs, const auto& rhs ) { return lhs.TimeAlloc() < rhs; } );
|
||||||
@ -70,7 +72,8 @@ unordered_flat_map<uint32_t, View::MemPathData> View::GetCallstackPaths( const M
|
|||||||
{
|
{
|
||||||
auto& ev = *it++;
|
auto& ev = *it++;
|
||||||
if( ev.CsAlloc() == 0 ) continue;
|
if( ev.CsAlloc() == 0 ) continue;
|
||||||
if( ( memRange == MemRange::Inactive ) == ( ev.TimeFree() >= 0 && ev.TimeFree() < m_memInfo.range.max ) ) continue;
|
const bool is_inactive = ev.TimeFree() >= 0 && ev.TimeFree() < m_memInfo.range.max;
|
||||||
|
if( hide_inactive == is_inactive ) continue;
|
||||||
auto pit = pathSum.find( ev.CsAlloc() );
|
auto pit = pathSum.find( ev.CsAlloc() );
|
||||||
if( pit == pathSum.end() )
|
if( pit == pathSum.end() )
|
||||||
{
|
{
|
||||||
@ -110,7 +113,8 @@ unordered_flat_map<uint32_t, View::MemPathData> View::GetCallstackPaths( const M
|
|||||||
for( auto& ev : mem.data )
|
for( auto& ev : mem.data )
|
||||||
{
|
{
|
||||||
if( ev.CsAlloc() == 0 ) continue;
|
if( ev.CsAlloc() == 0 ) continue;
|
||||||
if( ( memRange == MemRange::Inactive ) == ( ev.TimeFree() >= 0 ) ) continue;
|
const bool is_inactive = ev.TimeFree() >= 0;
|
||||||
|
if( hide_inactive == is_inactive ) continue;
|
||||||
auto it = pathSum.find( ev.CsAlloc() );
|
auto it = pathSum.find( ev.CsAlloc() );
|
||||||
if( it == pathSum.end() )
|
if( it == pathSum.end() )
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user