mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-22 14:44:34 +00:00
Keep track of rpmalloc thread shutdown state.
This commit is contained in:
parent
72ae4d2ee4
commit
20680fa6a3
@ -1120,6 +1120,7 @@ struct ProfilerThreadData
|
|||||||
std::atomic<int> RpInitDone { 0 };
|
std::atomic<int> RpInitDone { 0 };
|
||||||
std::atomic<int> RpInitLock { 0 };
|
std::atomic<int> RpInitLock { 0 };
|
||||||
thread_local bool RpThreadInitDone = false;
|
thread_local bool RpThreadInitDone = false;
|
||||||
|
thread_local bool RpThreadShutdown = false;
|
||||||
|
|
||||||
# ifdef TRACY_MANUAL_LIFETIME
|
# ifdef TRACY_MANUAL_LIFETIME
|
||||||
ProfilerData* s_profilerData = nullptr;
|
ProfilerData* s_profilerData = nullptr;
|
||||||
@ -1267,6 +1268,7 @@ static InitTimeWrapper init_order(101) s_initTime { SetupHwTimer() };
|
|||||||
std::atomic<int> init_order(102) RpInitDone( 0 );
|
std::atomic<int> init_order(102) RpInitDone( 0 );
|
||||||
std::atomic<int> init_order(102) RpInitLock( 0 );
|
std::atomic<int> init_order(102) RpInitLock( 0 );
|
||||||
thread_local bool RpThreadInitDone = false;
|
thread_local bool RpThreadInitDone = false;
|
||||||
|
thread_local bool RpThreadShutdown = false;
|
||||||
moodycamel::ConcurrentQueue<QueueItem> init_order(103) s_queue( QueuePrealloc );
|
moodycamel::ConcurrentQueue<QueueItem> init_order(103) s_queue( QueuePrealloc );
|
||||||
std::atomic<uint32_t> init_order(104) s_lockCounter( 0 );
|
std::atomic<uint32_t> init_order(104) s_lockCounter( 0 );
|
||||||
std::atomic<uint8_t> init_order(104) s_gpuCtxCounter( 0 );
|
std::atomic<uint8_t> init_order(104) s_gpuCtxCounter( 0 );
|
||||||
|
@ -1638,11 +1638,14 @@ _memory_adjust_size_class(size_t iclass) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern thread_local bool RpThreadShutdown;
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_memory_heap_finalize(void* heapptr) {
|
_memory_heap_finalize(void* heapptr) {
|
||||||
heap_t* heap = (heap_t*)heapptr;
|
heap_t* heap = (heap_t*)heapptr;
|
||||||
if (!heap)
|
if (!heap)
|
||||||
return;
|
return;
|
||||||
|
RpThreadShutdown = true;
|
||||||
//Release thread cache spans back to global cache
|
//Release thread cache spans back to global cache
|
||||||
#if ENABLE_THREAD_CACHE
|
#if ENABLE_THREAD_CACHE
|
||||||
_memory_heap_cache_adopt_deferred(heap);
|
_memory_heap_cache_adopt_deferred(heap);
|
||||||
|
Loading…
Reference in New Issue
Block a user