| 62 | } |
| 63 | |
| 64 | int64_t parse_i64_value(const std::string & value, std::string_view key) { |
| 65 | size_t parsed = 0; |
| 66 | const int64_t out = std::stoll(value, &parsed); |
| 67 | if (parsed != value.size()) { |
| 68 | throw std::runtime_error(std::string(key) + " must be an integer"); |
| 69 | } |
| 70 | return out; |
| 71 | } |
| 72 | |
| 73 | size_t checked_mib_to_bytes(int64_t mb, std::string_view key) { |
| 74 | constexpr int64_t kMiB = 1024 * 1024; |
no test coverage detected