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).

This commit is contained in:
David Farrell 2021-04-21 11:53:55 -07:00
parent da9a32fd09
commit be963f184c

View File

@ -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 );