| 175 | : ValueDescWriter(pool, /*values_capacity=*/256) {} |
| 176 | |
| 177 | void PushValue(ParsedValueDesc v) { |
| 178 | if (ARROW_PREDICT_FALSE(values_size_ == values_capacity_)) { |
| 179 | int64_t new_capacity = values_capacity_ * 2; |
| 180 | auto resize_status = values_buffer_->Resize(new_capacity * sizeof(*values_)); |
| 181 | if (resize_status.ok()) { |
| 182 | values_ = reinterpret_cast<ParsedValueDesc*>(values_buffer_->mutable_data()); |
| 183 | values_capacity_ = new_capacity; |
| 184 | } |
| 185 | status_ &= std::move(resize_status); |
| 186 | } |
| 187 | // The `values_` pointer may have become invalid if the `Resize` call above failed. |
| 188 | // Note that ResizableValueDescWriter is less performance-critical than |
| 189 | // PresizedValueDescWriter, as it should only be called on the first line(s) |
| 190 | // of CSV data. |
| 191 | if (ARROW_PREDICT_TRUE(status_.ok())) { |
| 192 | values_[values_size_++] = v; |
| 193 | } |
| 194 | } |
| 195 | }; |
| 196 | |
| 197 | // A helper class allocating the buffer for values offsets and writing into it |
nothing calls this directly
no test coverage detected