memory.cc - fixed typos and missing headers
This commit is contained in:
parent
643fef3a7c
commit
5e354b9221
@ -1,7 +1,9 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <ostream>
|
#include <sstream>
|
||||||
|
#include <fstream>
|
||||||
|
|
||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
|
#include "../luts.h"
|
||||||
|
|
||||||
std::string mem_string( bool use_colors = false ) {
|
std::string mem_string( bool use_colors = false ) {
|
||||||
std::ostringstream oss;
|
std::ostringstream oss;
|
||||||
@ -20,7 +22,7 @@ std::string mem_string( bool use_colors = false ) {
|
|||||||
getline( meminfo_file, mem_line );
|
getline( meminfo_file, mem_line );
|
||||||
substrStart = mem_line.find_first_of( ':' ) + 1;
|
substrStart = mem_line.find_first_of( ':' ) + 1;
|
||||||
substrLen = mem_line.find_first_of( 'k' );
|
substrLen = mem_line.find_first_of( 'k' );
|
||||||
total_mem = stoi(mem_line.substr(substrStart, substrLen);
|
total_mem = stoi(mem_line.substr(substrStart, substrLen));
|
||||||
|
|
||||||
used_mem = total_mem;
|
used_mem = total_mem;
|
||||||
|
|
||||||
@ -28,7 +30,7 @@ std::string mem_string( bool use_colors = false ) {
|
|||||||
getline( meminfo_file, mem_line );
|
getline( meminfo_file, mem_line );
|
||||||
substrStart = mem_line.find_first_of( ':' ) + 1;
|
substrStart = mem_line.find_first_of( ':' ) + 1;
|
||||||
substrLen = mem_line.find_first_of( 'k' );
|
substrLen = mem_line.find_first_of( 'k' );
|
||||||
unused_mem = stoi(mem_line.substr(substrStart, substrLen);
|
unused_mem = stoi(mem_line.substr(substrStart, substrLen));
|
||||||
used_mem -= unused_mem;
|
used_mem -= unused_mem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user