Add checking hardware instruction set on Windows earlier on

#3732
This commit is contained in:
Wojtek Figat
2025-10-27 16:48:24 +01:00
parent c944bd9bed
commit cd66d00219
2 changed files with 20 additions and 5 deletions

View File

@@ -6,6 +6,10 @@
#include "../common/TracyYield.hpp"
#if PLATFORM_WINDOWS
extern void CheckInstructionSet();
#endif
namespace tracy
{
@@ -18,6 +22,10 @@ tracy_no_inline static void InitRpmallocPlumbing()
const auto done = RpInitDone.load( std::memory_order_acquire );
if( !done )
{
#if PLATFORM_WINDOWS
// Check instruction set before executing any code (Tracy init static vars before others)
CheckInstructionSet();
#endif
int expected = 0;
while( !RpInitLock.compare_exchange_weak( expected, 1, std::memory_order_release, std::memory_order_relaxed ) ) { expected = 0; YieldThread(); }
const auto done = RpInitDone.load( std::memory_order_acquire );