| 286 | /// \return A span<T> of the requested length |
| 287 | template <typename T> |
| 288 | std::span<T> GetMutableSpan(int i, int64_t length) { |
| 289 | if (!buffers[i]) { |
| 290 | assert(length == 0); |
| 291 | return {}; |
| 292 | } |
| 293 | const int64_t buffer_length = buffers[i]->size() / static_cast<int64_t>(sizeof(T)); |
| 294 | assert(i > 0 && length + offset <= buffer_length); |
| 295 | ARROW_UNUSED(buffer_length); |
| 296 | return std::span<T>(buffers[i]->mutable_data_as<T>() + this->offset, length); |
| 297 | } |
| 298 | |
| 299 | /// \brief Access a buffer's data as a typed C pointer |
| 300 | /// |