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

the dll will not be completely uninstalled,

so the stack and the heap content of the thread need to be refreshed
This commit is contained in:
JIA-ss 2021-07-21 21:53:29 +08:00
parent 06ae39d9cc
commit d5881e23b6

View File

@ -960,11 +960,13 @@ thread_local bool RpThreadInitDone = false;
# ifdef TRACY_MANUAL_LIFETIME
ProfilerData* s_profilerData = nullptr;
static ProfilerThreadData& GetProfilerThreadData();
TRACY_API void StartupProfiler()
{
s_profilerData = (ProfilerData*)tracy_malloc( sizeof( ProfilerData ) );
new (s_profilerData) ProfilerData();
s_profilerData->profiler.SpawnWorkerThreads();
GetProfilerThreadData().token = ProducerWrapper(*s_profilerData);
}
static ProfilerData& GetProfilerData()
{
@ -977,6 +979,8 @@ TRACY_API void ShutdownProfiler()
tracy_free( s_profilerData );
s_profilerData = nullptr;
rpmalloc_finalize();
RpThreadInitDone = false;
RpInitDone.store(0, std::memory_order_release);
}
# else
static std::atomic<int> profilerDataLock { 0 };