some lil things
This commit is contained in:
parent
b189049ab4
commit
4c993f6dd8
3 changed files with 447 additions and 7 deletions
|
@ -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; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue