| 819 | } |
| 820 | |
| 821 | Status ValidateOverflow(int64_t new_bytes) const { |
| 822 | auto new_size = byte_builder_.length() + new_bytes; |
| 823 | if (ARROW_PREDICT_FALSE(new_size > memory_limit())) { |
| 824 | return Status::CapacityError("array cannot contain more than ", memory_limit(), |
| 825 | " bytes, have ", new_size); |
| 826 | } else { |
| 827 | return Status::OK(); |
| 828 | } |
| 829 | } |
| 830 | |
| 831 | /// \brief Ensures there is enough allocated capacity to append the indicated |
| 832 | /// number of bytes to the value data buffer without additional allocations |
no test coverage detected