1
0
mirror of https://github.com/wolfpld/tracy.git synced 2025-03-20 07:40:02 +08:00

Add memory discard message.

This can be used to erase all allocations made within the named memory
pool. The usual use case would be for arena allocators, which allocate
by advancing a pointer and never have to free the memory. There is no
tracking of individual allocations and everything is freed frequently,
by reseting the pointer, for example once per frame.

Since this is used in special-purpose allocators, there is no support
for discarding the memory of the default memory pool.
This commit is contained in:
Bartosz Taudul
2024-10-21 17:32:54 +02:00
parent 3dc68bcb76
commit f4df9013bb
5 changed files with 80 additions and 1 deletions
+9
View File
@@ -2862,6 +2862,15 @@ Profiler::DequeueStatus Profiler::DequeueSerial()
MemWrite( &item->memFree.time, dt );
break;
}
case QueueType::MemDiscard:
case QueueType::MemDiscardCallstack:
{
int64_t t = MemRead<int64_t>( &item->memDiscard.time );
int64_t dt = t - refSerial;
refSerial = t;
MemWrite( &item->memDiscard.time, dt );
break;
}
case QueueType::GpuZoneBeginSerial:
case QueueType::GpuZoneBeginCallstackSerial:
{