bench: Require semicolon after BENCHMARK(foo)

This makes the code more consistent.

Also, use "using BenchFunction = ..." while touching the header.

Also, fixup the whitespace after and earlier scripted-diff.
This commit is contained in:
MarcoFalke
2026-01-13 08:43:12 +01:00
parent fa8938f08c
commit fa3df52712
3 changed files with 6 additions and 6 deletions

View File

@@ -38,7 +38,7 @@ namespace benchmark {
using ankerl::nanobench::Bench;
typedef std::function<void(Bench&)> BenchFunction;
using BenchFunction = std::function<void(Bench&)>;
struct Args {
bool is_list_only;
@@ -64,8 +64,8 @@ public:
};
} // namespace benchmark
// BENCHMARK(foo) expands to: benchmark::BenchRunner bench_runner_foo{"foo", foo};
// BENCHMARK(foo); expands to: benchmark::BenchRunner bench_runner_foo{"foo", foo};
#define BENCHMARK(n) \
benchmark::BenchRunner PASTE2(bench_runner_, n){STRINGIZE(n), n};
benchmark::BenchRunner PASTE2(bench_runner_, n) { STRINGIZE(n), n }
#endif // BITCOIN_BENCH_BENCH_H

View File

@@ -116,7 +116,7 @@ static void PrevectorFillVectorIndirect(benchmark::Bench& bench)
{ \
Prevector##name<nontrivial_t>(bench); \
} \
BENCHMARK(Prevector##name##Nontrivial); \
BENCHMARK(Prevector##name##Nontrivial); \
static void Prevector##name##Trivial(benchmark::Bench& bench) \
{ \
Prevector##name<trivial_t>(bench); \

View File

@@ -215,6 +215,6 @@ static void WalletCreateTxUsePresetInputsAndCoinSelection(benchmark::Bench& benc
static void WalletAvailableCoins(benchmark::Bench& bench) { AvailableCoins(bench, {OutputType::BECH32M}); }
BENCHMARK(WalletCreateTxUseOnlyPresetInputs)
BENCHMARK(WalletCreateTxUsePresetInputsAndCoinSelection)
BENCHMARK(WalletCreateTxUseOnlyPresetInputs);
BENCHMARK(WalletCreateTxUsePresetInputsAndCoinSelection);
BENCHMARK(WalletAvailableCoins);