| 4290 | } |
| 4291 | |
| 4292 | void Profiler::MemAllocCallstack( const void* ptr, size_t size, int depth, bool secure ) |
| 4293 | { |
| 4294 | if( secure && !ProfilerAvailable() ) return; |
| 4295 | if( depth > 0 && has_callstack() ) |
| 4296 | { |
| 4297 | auto& profiler = GetProfiler(); |
| 4298 | # ifdef TRACY_ON_DEMAND |
| 4299 | if( !profiler.IsConnected() ) return; |
| 4300 | # endif |
| 4301 | const auto thread = GetThreadHandle(); |
| 4302 | |
| 4303 | auto callstack = Callstack( depth ); |
| 4304 | |
| 4305 | profiler.m_serialLock.lock(); |
| 4306 | SendCallstackSerial( callstack ); |
| 4307 | SendMemAlloc( QueueType::MemAllocCallstack, thread, ptr, size ); |
| 4308 | profiler.m_serialLock.unlock(); |
| 4309 | } |
| 4310 | else |
| 4311 | { |
| 4312 | MemAlloc( ptr, size, secure ); |
| 4313 | } |
| 4314 | } |
| 4315 | |
| 4316 | void Profiler::MemFreeCallstack( const void* ptr, int depth, bool secure ) |
| 4317 | { |
nothing calls this directly
no test coverage detected