aboutsummaryrefslogtreecommitdiffhomepage
path: root/bench/BenchTimer.h
diff options
context:
space:
mode:
Diffstat (limited to 'bench/BenchTimer.h')
-rw-r--r--bench/BenchTimer.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/bench/BenchTimer.h b/bench/BenchTimer.h
index 28e2bcaea..64666d75f 100644
--- a/bench/BenchTimer.h
+++ b/bench/BenchTimer.h
@@ -28,6 +28,14 @@
# include <unistd.h>
#endif
+static void escape(void *p) {
+ asm volatile("" : : "g"(p) : "memory");
+}
+
+static void clobber() {
+ asm volatile("" : : : "memory");
+}
+
#include <Eigen/Core>
namespace Eigen
@@ -168,6 +176,7 @@ public:
CODE; \
} \
TIMER.stop(); \
+ clobber(); \
} \
}