backout previous mem changes. only punt mtrr to rounding if > 1 write-back register
This commit is contained in:
1 parent
5ff5b9d145
commit
3ff6042aaf
2 files changed
+71
-6
No files matched your search
+5
-5
@@ -312,12 +312,12 @@ int sigar_proc_count(sigar_t *sigar, sigar_uint64_t *total)
|
||||
|
||||
int sigar_mem_calc_ram(sigar_t *sigar, sigar_mem_t *mem)
|
||||
{
|
||||
sigar_uint64_t total = (mem->total / (1024 * 1024));
|
||||
int size = (int)total; /* must cast after division */
|
||||
int ram;
|
||||
sigar_uint64_t lram = (mem->total / (1024 * 1024));
|
||||
int ram = (int)lram; /* must cast after division */
|
||||
int remainder = ram % 8;
|
||||
|
||||
for (ram=1; size; size >>= 1) {
|
||||
ram <<= 1;
|
||||
if (remainder > 0) {
|
||||
ram += (8 - remainder);
|
||||
}
|
||||
|
||||
mem->ram = ram;
|
||||
|
||||
Reference in new issue
Block a user