23 const std::string_view value =
getenv_value(
"CUSBF_FASTX_HOST_RAM_SLACK_MB");
32 return static_cast<size_t>(
mebibytes) << 20;
uint64_t fastx_memory_map_max_bytes()
Upper bound on file bytes that may be mmap'd (env cap and available RAM minus slack).
size_t fastx_host_ram_slack_bytes()
bool fastx_file_fits_in_memory(const std::filesystem::path &path)
True when uncompressed path size is within fastx_memory_map_max_bytes.
size_t query_available_host_bytes()
Available physical RAM (bytes) for mmap budgeting.
constexpr size_t kDefaultFastxHostRamSlackBytes
Default headroom left for the OS and other processes when sizing mmap.
uint64_t parse_env_mebibytes(std::string_view value)
Parses a decimal mebibyte count from value.
consteval bool separatorPositionAlwaysEncodesInvalid(char *input, uint64_t separatorPosition, uint64_t index)
Recursively tests whether placing the separator byte at any position in an input of valid bytes alway...
std::string_view getenv_value(const char *env_name)
Reads env_name via getenv, or an empty view when unset.