From be963f184ce98f6e067eaa238d7b38cc14d50c44 Mon Sep 17 00:00:00 2001 From: David Farrell Date: Wed, 21 Apr 2021 11:53:55 -0700 Subject: [PATCH] Change ev.ptr nullptr early-out to happen only when there is not a previous allocation for address 0. Custom memory pools (like custom allocators for Vulkan memory pools) can allocate at address 0, so the previous code would cause the Tracy server to alloc(0), free(0) (but early out), then on the next alloc(0) it would have a MemAllocTwiceFailure (because it skipped the free). --- server/TracyWorker.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/TracyWorker.cpp b/server/TracyWorker.cpp index bdd11cf3..b6995498 100644 --- a/server/TracyWorker.cpp +++ b/server/TracyWorker.cpp @@ -5602,11 +5602,11 @@ MemEvent* Worker::ProcessMemFreeImpl( uint64_t memname, MemData& memdata, const const auto refTime = m_refTimeSerial + ev.time; m_refTimeSerial = refTime; - if( ev.ptr == 0 ) return nullptr; - auto it = memdata.active.find( ev.ptr ); if( it == memdata.active.end() ) { + if( ev.ptr == 0 ) return nullptr; + if( !m_ignoreMemFreeFaults ) { CheckThreadString( ev.thread );