| 216 | pool, /*values_capacity=*/2 + static_cast<int64_t>(num_rows) * num_cols) {} |
| 217 | |
| 218 | void PushValue(ParsedValueDesc v) { |
| 219 | DCHECK_LT(values_size_, values_capacity_); |
| 220 | values_[values_size_] = v; |
| 221 | // We must take care not to write past the buffer's end if the line being |
| 222 | // parsed has more than `num_cols` columns. The obvious solution of setting |
| 223 | // an error status hurts too much on benchmarks, which is why we instead |
| 224 | // cap `values_size_` to stay inside the buffer. |
| 225 | // |
| 226 | // Not setting an error immediately is not a problem since the `num_cols` |
| 227 | // mismatch is detected later in ParseLine. |
| 228 | // |
| 229 | // Note that we want `values_size_` to reflect the number of written values |
| 230 | // in the nominal case, which is why we choose a slightly larger `values_capacity_`. |
| 231 | values_size_ += (values_size_ != values_capacity_ - 1); |
| 232 | } |
| 233 | }; |
| 234 | |
| 235 | } // namespace |
no outgoing calls
no test coverage detected