Skip to content

Commit

Permalink
Fix reading published sample
Browse files Browse the repository at this point in the history
This benchmark was missed in the update in 3521e96.

Co-authored-by: @drslebedev
Signed-off-by: Dennis Klein <d.klein@gsi.de>
  • Loading branch information
dennisklein authored and RalphSteinhagen committed Sep 6, 2024
1 parent c723af1 commit 53439cf
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions core/benchmarks/bm_HistoryBuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,12 @@ inline const boost::ut::suite _buffer_tests = [] {

"circular_buffer<int>(32) - no checks"_benchmark.repeat<n_repetitions>(samples) = [&writer, &reader] {
static int counter = 0;
auto pSpan = writer.tryReserve(1LU);
boost::ut::expect(!pSpan.empty());
pSpan[0] = counter;
for (std::size_t i = 0; i < samples; i++) {
pSpan.publish(1);
{
PublishableSpan auto pSpan = writer.tryReserve<SpanReleasePolicy::ProcessAll>(1LU);
boost::ut::expect(!pSpan.empty());
pSpan[0] = counter;
}
gr::ConsumableSpan auto range = reader.get(1);
[[maybe_unused]] const auto data = range[0];
[[maybe_unused]] const auto ret = range.consume(1);
Expand Down

0 comments on commit 53439cf

Please sign in to comment.