| 190 | } |
| 191 | |
| 192 | size_t parse_size_mb_option( |
| 193 | const std::unordered_map<std::string, std::string> & options, |
| 194 | std::initializer_list<std::string_view> keys, |
| 195 | size_t fallback_bytes) { |
| 196 | if (const auto match = find_option_match(options, keys)) { |
| 197 | const int64_t mb = parse_i64_value(match->value, match->key); |
| 198 | if (mb <= 0) { |
| 199 | throw std::runtime_error(match->key + " must be positive"); |
| 200 | } |
| 201 | return checked_mib_to_bytes(mb, match->key); |
| 202 | } |
| 203 | return fallback_bytes; |
| 204 | } |
| 205 | |
| 206 | uint64_t random_u64_seed() { |
| 207 | std::random_device random_device; |
no test coverage detected