Replace deprecated _ReadWriteBarrier with std::atomic_signal_fence in MSVC path (#2177) * Replace deprecated _ReadWriteBarrier with std::atomic_signal_fence * use ClobberMemory() instead of inlining atomic_signal_fence * add qorexdev to AUTHORS and CONTRIBUTORS --------- Co-authored-by: dominic <510002+dmah42@users.noreply.github.com>
diff --git a/AUTHORS b/AUTHORS index bea19b3..00ac593 100644 --- a/AUTHORS +++ b/AUTHORS
@@ -61,6 +61,7 @@ Ori Livneh <ori.livneh@gmail.com> Paul Redmond <paul.redmond@gmail.com> Prithvi Rao <ee22b024@smail.iitm.ac.in> +qorexdev <sanenkosana600@gmail.com> Radoslav Yovchev <radoslav.tm@gmail.com> Raghu Raja <raghu@enfabrica.net> Rainer Orth <ro@cebitec.uni-bielefeld.de>
diff --git a/CONTRIBUTORS b/CONTRIBUTORS index c3f6789..4016558 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS
@@ -85,6 +85,7 @@ Paul Redmond <paul.redmond@gmail.com> Pierre Phaneuf <pphaneuf@google.com> Prithvi Rao <ee22b024@smail.iitm.ac.in> +qorexdev <sanenkosana600@gmail.com> Radoslav Yovchev <radoslav.tm@gmail.com> Raghu Raja <raghu@enfabrica.net> Rainer Orth <ro@cebitec.uni-bielefeld.de>
diff --git a/include/benchmark/utils.h b/include/benchmark/utils.h index 681d938..0e4d95d 100644 --- a/include/benchmark/utils.h +++ b/include/benchmark/utils.h
@@ -127,19 +127,19 @@ "undesired compiler optimizations in benchmarks") inline BENCHMARK_ALWAYS_INLINE void DoNotOptimize(Tp const& value) { internal::UseCharPointer(&reinterpret_cast<char const volatile&>(value)); - _ReadWriteBarrier(); + ClobberMemory(); } template <class Tp> inline BENCHMARK_ALWAYS_INLINE void DoNotOptimize(Tp& value) { internal::UseCharPointer(&reinterpret_cast<char const volatile&>(value)); - _ReadWriteBarrier(); + ClobberMemory(); } template <class Tp> inline BENCHMARK_ALWAYS_INLINE void DoNotOptimize(Tp&& value) { internal::UseCharPointer(&reinterpret_cast<char const volatile&>(value)); - _ReadWriteBarrier(); + ClobberMemory(); } #else template <class Tp>