From 332c512eed3ab59b0613c8202aae708c20a02de4 Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Thu, 8 Apr 2021 15:38:21 +0300 Subject: [PATCH] shared_ptr.hpp: minor optimization (GCC hotfix) Use thread_local for dummy objects (doesn't work on MSVC). Couldn't find better way to remove fake static objects completely. In a sense that they don't appear in object files. --- rpcs3/util/shared_ptr.hpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/rpcs3/util/shared_ptr.hpp b/rpcs3/util/shared_ptr.hpp index a3b339845d..f99b0414d4 100644 --- a/rpcs3/util/shared_ptr.hpp +++ b/rpcs3/util/shared_ptr.hpp @@ -19,7 +19,12 @@ namespace stx }; template - static const fake_t> sample{}; +#ifdef _MSC_VER + static const +#else + static thread_local const +#endif + fake_t> sample{}; } template