| 452 | |
| 453 | template <int64_t OffsetSrc, int64_t OffsetDest = 0> |
| 454 | static void CopyBitmap(benchmark::State& state) { // NOLINT non-const reference |
| 455 | const int64_t buffer_size = state.range(0); |
| 456 | const int64_t bits_size = buffer_size * 8; |
| 457 | std::shared_ptr<Buffer> buffer = CreateRandomBuffer(buffer_size); |
| 458 | |
| 459 | const uint8_t* src = buffer->data(); |
| 460 | const int64_t length = bits_size - OffsetSrc; |
| 461 | |
| 462 | auto copy = *AllocateEmptyBitmap(length + OffsetDest); |
| 463 | |
| 464 | for (auto _ : state) { |
| 465 | internal::CopyBitmap(src, OffsetSrc, length, copy->mutable_data(), OffsetDest); |
| 466 | } |
| 467 | |
| 468 | state.SetBytesProcessed(state.iterations() * buffer_size); |
| 469 | } |
| 470 | |
| 471 | static void CopyBitmapWithoutOffset( |
| 472 | benchmark::State& state) { // NOLINT non-const reference |
no test coverage detected