MCPcopy Create free account
hub / github.com/apache/arrow / GetNextAlignedByte

Function GetNextAlignedByte

cpp/src/arrow/util/bpacking_benchmark.cc:59–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

57}
58
59const uint8_t* GetNextAlignedByte(const uint8_t* ptr, std::size_t alignment) {
60 auto addr = reinterpret_cast<std::uintptr_t>(ptr);
61
62 if (addr % alignment == 0) {
63 return ptr;
64 }
65
66 auto remainder = addr % alignment;
67 auto bytes_to_add = alignment - remainder;
68
69 return ptr + bytes_to_add;
70}
71
72template <typename Int>
73void BM_Unpack(benchmark::State& state, bool aligned, UnpackFunc<Int> unpack, bool skip,

Callers 1

BM_UnpackFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected