| 642 | |
| 643 | template <typename T> |
| 644 | Y_FORCE_INLINE void DoNotOptimizeAway(T&& datum) { |
| 645 | #if defined(_MSC_VER) |
| 646 | UseCharPointerImpl(&reinterpret_cast<volatile const char&>(datum)); |
| 647 | _ReadWriteBarrier(); |
| 648 | #elif defined(__GNUC__) && defined(_x86_) |
| 649 | asm volatile("" |
| 650 | : |
| 651 | : "X"(datum)); |
| 652 | #else |
| 653 | Y_FAKE_READ(datum); |
| 654 | #endif |
| 655 | } |
| 656 | |
| 657 | /** |
| 658 | * The usage for `const T&` is prohibited. |
no test coverage detected