\brief Get the mutable pointer to the fixed-width values of an array allocated by PreallocateFixedWidthArrayData. \pre mutable_array->offset and the offset of child array (if it's a FixedSizeList) MUST be 0 (recursively). \pre IsFixedWidthLike(ArraySpan(mutable_array)) or the more restrictive is_fixed_width(*mutable_array->type) MUST be true \return The mutable pointer to the fixed-width byte blo
| 213 | /// \return The mutable pointer to the fixed-width byte blocks of the array. If |
| 214 | /// pre-conditions are not satisfied, the return values is undefined. |
| 215 | uint8_t* MutableFixedWidthValuesPointer(ArrayData* mutable_array) { |
| 216 | auto* array = mutable_array; |
| 217 | auto type_id = array->type->id(); |
| 218 | while (type_id == Type::FIXED_SIZE_LIST) { |
| 219 | DCHECK_EQ(array->offset, 0); |
| 220 | DCHECK_EQ(array->child_data.size(), 1) << array->type->ToString(true) << " part of " |
| 221 | << mutable_array->type->ToString(true); |
| 222 | array = array->child_data[0].get(); |
| 223 | type_id = array->type->id(); |
| 224 | } |
| 225 | DCHECK_EQ(mutable_array->offset, 0); |
| 226 | // BOOL is allowed here only because the offset is expected to be 0, |
| 227 | // so the byte-aligned pointer also points to the first *bit* of the buffer. |
| 228 | DCHECK(is_fixed_width(type_id)); |
| 229 | return array->GetMutableValues<uint8_t>(1, 0); |
| 230 | } |
| 231 | |
| 232 | } // namespace arrow::util |
no test coverage detected