Last active
February 5, 2023 18:08
-
-
Save pankkor/87b25aa8a9bc8841d39dbbe4a572f228 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// disable optimisations | |
#ifdef _MSC_VER | |
#pragma optimize("", off) | |
inline void bench_opt_off(const void*) {} | |
#pragma optimize("", on) | |
#define ESCAPE(p) bench_opt_off(p) | |
#define CLOBBER(p) bench_opt_off(p) | |
#else | |
#define ESCAPE(p) asm volatile("" : : "m"(p) : "memory") | |
#define CLOBBER() asm volatile("" : : : "memory") | |
#endif // #ifdef _MSC_VER |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment