Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/src/Progmasoft
diff options
context:
space:
mode:
authorMartin Hořeňovský2026-08-22 15:19:33 +0200
committerMartin Hořeňovský2026-08-22 20:43:13 +0200
commit45f9ea1e798c2e128dcba53602ccbddfe5676f6f (patch)
tree3eb107a59de8a5654109fc594ee29b3e5c57770d /src/Progmasoft
parent9915f7250dcfc2c7bbd9e86c83b29438df39d856 (diff)
downloadcatch3-45f9ea1e798c2e128dcba53602ccbddfe5676f6f.tar.gz
Add optimizer barrier to benchmark calls of void-returning functions
The goal is to do the equivalent of clobbering memory, which forces the compiler to keep side effects that are external to the benchmarked function, while allowing it to optimize inside the benchmarked function. E.g. this cannot be optimized away: ```cpp BENCHMARK("foo") { global_count += 1; }; ``` while this can: ```cpp BENCHMARK("bar") { size_t local_count = 0; for (size_t i = 0; i < 100; ++i) { local_count += 1; } }; ```
Diffstat (limited to 'src/Progmasoft')
0 files changed, 0 insertions, 0 deletions