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

Function CheckSelfAlignment

cpp/src/arrow/util/align_util.cc:63–83  ·  view source on GitHub ↗

Checks to see if an array's own buffers are aligned but doesn't check children

Source from the content-addressed store, hash-verified

61// Checks to see if an array's own buffers are aligned but doesn't check
62// children
63bool CheckSelfAlignment(const ArrayData& array, int64_t alignment) {
64 if (alignment == kValueAlignment) {
65 Type::type type_id = GetTypeForBuffers(array);
66 for (std::size_t i = 0; i < array.buffers.size(); i++) {
67 if (array.buffers[i]) {
68 int expected_alignment =
69 RequiredValueAlignmentForBuffer(type_id, static_cast<int>(i));
70 if (!CheckAlignment(*array.buffers[i], expected_alignment)) {
71 return false;
72 }
73 }
74 }
75 } else {
76 for (const auto& buffer : array.buffers) {
77 if (buffer) {
78 if (!CheckAlignment(*buffer, alignment)) return false;
79 }
80 }
81 }
82 return true;
83}
84
85} // namespace
86

Callers 1

CheckAlignmentFunction · 0.85

Calls 4

GetTypeForBuffersFunction · 0.85
CheckAlignmentFunction · 0.70
sizeMethod · 0.45

Tested by

no test coverage detected