diff --git a/src/bench/checkqueue.cpp b/src/bench/checkqueue.cpp --- a/src/bench/checkqueue.cpp +++ b/src/bench/checkqueue.cpp @@ -44,8 +44,9 @@ std::vector> vBatches(BATCHES); for (auto &vChecks : vBatches) { vChecks.reserve(BATCH_SIZE); - for (size_t x = 0; x < BATCH_SIZE; ++x) + for (size_t x = 0; x < BATCH_SIZE; ++x) { vChecks.emplace_back(insecure_rand); + } control.Add(vChecks); } // control waits for completion by RAII, but it is done explicitly here diff --git a/src/bench/crypto_hash.cpp b/src/bench/crypto_hash.cpp --- a/src/bench/crypto_hash.cpp +++ b/src/bench/crypto_hash.cpp @@ -23,22 +23,25 @@ static void RIPEMD160(benchmark::State &state) { uint8_t hash[CRIPEMD160::OUTPUT_SIZE]; std::vector in(BUFFER_SIZE, 0); - while (state.KeepRunning()) + while (state.KeepRunning()) { CRIPEMD160().Write(in.data(), in.size()).Finalize(hash); + } } static void SHA1(benchmark::State &state) { uint8_t hash[CSHA1::OUTPUT_SIZE]; std::vector in(BUFFER_SIZE, 0); - while (state.KeepRunning()) + while (state.KeepRunning()) { CSHA1().Write(in.data(), in.size()).Finalize(hash); + } } static void SHA256(benchmark::State &state) { uint8_t hash[CSHA256::OUTPUT_SIZE]; std::vector in(BUFFER_SIZE, 0); - while (state.KeepRunning()) + while (state.KeepRunning()) { CSHA256().Write(in.data(), in.size()).Finalize(hash); + } } static void SHA256_32b(benchmark::State &state) { @@ -58,8 +61,9 @@ static void SHA512(benchmark::State &state) { uint8_t hash[CSHA512::OUTPUT_SIZE]; std::vector in(BUFFER_SIZE, 0); - while (state.KeepRunning()) + while (state.KeepRunning()) { CSHA512().Write(in.data(), in.size()).Finalize(hash); + } } static void SipHash_32b(benchmark::State &state) { diff --git a/src/bench/lockedpool.cpp b/src/bench/lockedpool.cpp --- a/src/bench/lockedpool.cpp +++ b/src/bench/lockedpool.cpp @@ -19,8 +19,9 @@ Arena b(synth_base, synth_size, 16); std::vector addr; - for (int x = 0; x < ASIZE; ++x) + for (int x = 0; x < ASIZE; ++x) { addr.push_back(nullptr); + } uint32_t s = 0x12345678; while (state.KeepRunning()) { for (int x = 0; x < BITER; ++x) { @@ -33,11 +34,14 @@ } bool lsb = s & 1; s >>= 1; - if (lsb) s ^= 0xf00f00f0; // LFSR period 0xf7ffffe0 + if (lsb) { + s ^= 0xf00f00f0; // LFSR period 0xf7ffffe0 + } } } - for (void *ptr : addr) + for (void *ptr : addr) { b.free(ptr); + } addr.clear(); }