summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/common/x64/native_clock.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/common/x64/native_clock.cpp b/src/common/x64/native_clock.cpp
index 63364f839..7fd9d22f8 100644
--- a/src/common/x64/native_clock.cpp
+++ b/src/common/x64/native_clock.cpp
@@ -16,15 +16,17 @@
namespace Common {
-inline u64 FencedRDTSC() {
#ifdef _MSC_VER
+__forceinline static u64 FencedRDTSC() {
_mm_lfence();
_ReadWriteBarrier();
const u64 result = __rdtsc();
_mm_lfence();
_ReadWriteBarrier();
return result;
+}
#else
+static u64 FencedRDTSC() {
u64 result;
asm volatile("lfence\n\t"
"rdtsc\n\t"
@@ -35,8 +37,8 @@ inline u64 FencedRDTSC() {
:
: "rdx", "memory", "cc");
return result;
-#endif
}
+#endif
u64 EstimateRDTSCFrequency() {
// Discard the first result measuring the rdtsc.