mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-27 18:43:48 +00:00
Fix AssertFatal/TORQUE_UNUSED are not optimized on release build causing performance problems.
http://cnicholson.net/2009/02/stupid-c-tricks-adventures-in-assert/ > "Both gcc and MSVC are smart enough to optimize out the evaluation of x, but only if they can determine if there are no side effects associated with the evaluation. Unfortunately, this can only be done if the body of x is known entirely to the compiler. If x is a function call to another module MSVC can still make it go away with Link-Time Code Generation (via cross-module inlining), but poor gcc is dead in the water and emits the call. Either way, we’re relying on compiler and linker optimizations to make this code go away."
This commit is contained in:
parent
437d968cb2
commit
ac96ac7568
1 changed files with 1 additions and 1 deletions
|
|
@ -40,7 +40,7 @@ typedef double F64; ///< Compiler independent 64-bit float
|
|||
|
||||
struct EmptyType {}; ///< "Null" type used by templates
|
||||
|
||||
#define TORQUE_UNUSED(var) (void)(var)
|
||||
#define TORQUE_UNUSED(var) (void)sizeof(var)
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
//------------------------------------- String Types
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue