From 1b55dce613dab6122aa7660d546328e83b103534 Mon Sep 17 00:00:00 2001 From: Robert MacGregor Date: Wed, 1 Sep 2021 21:12:12 -0400 Subject: [PATCH] * Workaround: Implement noinline attributes for problematic functions in str.cpp due to what appears to be GCC compiler bugs. --- Engine/source/core/util/str.cpp | 4 ++-- Engine/source/platform/types.gcc.h | 3 +++ Engine/source/platform/types.visualc.h | 2 ++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Engine/source/core/util/str.cpp b/Engine/source/core/util/str.cpp index c93a95aba..bec26609b 100644 --- a/Engine/source/core/util/str.cpp +++ b/Engine/source/core/util/str.cpp @@ -284,8 +284,8 @@ class String::StringData : protected StringDataImpl delete [] mUTF16; } - void* operator new(size_t size, U32 len); - void* operator new( size_t size, U32 len, DataChunker& chunker ); + void* TORQUE_NOINLINE operator new(size_t size, U32 len); + void* TORQUE_NOINLINE operator new( size_t size, U32 len, DataChunker& chunker ); void operator delete(void *); bool isShared() const diff --git a/Engine/source/platform/types.gcc.h b/Engine/source/platform/types.gcc.h index 53538dd8d..a36759bc0 100644 --- a/Engine/source/platform/types.gcc.h +++ b/Engine/source/platform/types.gcc.h @@ -165,5 +165,8 @@ typedef unsigned long U64; #endif #endif +// Set GCC noinline +#define TORQUE_NOINLINE __attribute__ ((noinline)) + #endif // INCLUDED_TYPES_GCC_H diff --git a/Engine/source/platform/types.visualc.h b/Engine/source/platform/types.visualc.h index 57dabc4dd..4b937ddf8 100644 --- a/Engine/source/platform/types.visualc.h +++ b/Engine/source/platform/types.visualc.h @@ -104,6 +104,8 @@ typedef unsigned _int64 U64; // see msdn.microsoft.com "Compiler Warning (level 1) C4291" for more details #pragma warning(disable: 4291) +// Set MSVC noline attribute +#define TORQUE_NOINLINE __declspec(noinline) #endif // INCLUDED_TYPES_VISUALC_H