some lil things

This commit is contained in:
Mars 2024-08-03 01:29:36 +00:00
parent b189049ab4
commit 4c993f6dd8
3 changed files with 447 additions and 7 deletions

View file

@ -32,10 +32,7 @@ fn MeminfoParse(std::ifstream input) -> u64 {
// Skip every line before the one that starts with "MemTotal"
while (std::getline(input, line) && !line.starts_with("MemTotal"));
// Parse the number from the line
const u64 num = ParseLineAsNumber(line);
return num;
return ParseLineAsNumber(line);
}
fn GetMemInfo() -> u64 { return MeminfoParse(std::ifstream("/proc/meminfo")) * 1024; }