MCPcopy Create free account
hub / github.com/DaedalusX64/daedalus / Exit

Method Exit

Source/Utility/Profiler.cpp:344–373  ·  view source on GitHub ↗

Stop profiling for an item

Source from the content-addressed store, hash-verified

342
343// Stop profiling for an item
344void CProfilerImpl::Exit( SProfileItemHandle handle )
345{
346 DAEDALUS_ASSERT( handle.Handle < mItems.size(), "Invalid handle!" );
347 DAEDALUS_ASSERT( mActiveCallstacks.size() == mActiveItems.size(), "Why are there different numbers of callstacks/items?" );
348
349 u64 now = GetNow();
350 CProfileItem * item = mItems[ handle.Handle ];
351
352 if( !mActiveItems.empty() )
353 {
354 if( item == mActiveItems.back() )
355 {
356 CProfileCallstack * callstack = mActiveCallstacks.back();
357 mActiveItems.pop_back();
358 mActiveCallstacks.pop_back();
359
360 callstack->StopTiming( now );
361 }
362 else
363 {
364 DAEDALUS_ERROR( "Popping the wrong item" );
365 }
366 }
367 else
368 {
369 DAEDALUS_ERROR( "Item stack underflow" );
370 }
371
372 DAEDALUS_ASSERT( mActiveCallstacks.size() == mActiveItems.size(), "Why are there different numbers of callstacks/items?" );
373}
374
375void CProfileCallstack::Reset()
376{

Callers 1

~CAutoProfileMethod · 0.45

Calls 4

GetNowFunction · 0.85
sizeMethod · 0.80
emptyMethod · 0.80
StopTimingMethod · 0.80

Tested by

no test coverage detected