1
0
mirror of https://github.com/google/benchmark.git synced 2025-04-29 06:20:32 +08:00

add comments about DoNotOptimize

This commit is contained in:
Eric Fiselier 2015-03-27 04:40:41 -04:00
parent 4567e70d38
commit 0aac2b869a

View File

@ -178,6 +178,10 @@ void UseCharPointer(char const volatile*);
} // end namespace internal
// The DoNotOptimize(...) function can be used to prevent a value or
// expression from being optimized away by the compiler. This function is
// intented to add little to no overhead.
// See: http://stackoverflow.com/questions/28287064
#if defined(__GNUC__)
template <class Tp>
inline BENCHMARK_ALWAYS_INLINE void DoNotOptimize(Tp& value) {