From d1a2f6371a3223da24a34eba800c365d21805780 Mon Sep 17 00:00:00 2001 From: Alex Smith Date: Wed, 10 Jul 2013 14:02:05 +0100 Subject: [PATCH] sysinfo: Fixed incorrect memory stats on PAE systems. Memory statistics were calculated as 32-bit values, so they were incorrect on machines with more than 4GB RAM (and on x86_64). --- src/bin/sysinfo.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/bin/sysinfo.cpp b/src/bin/sysinfo.cpp index bff7ec31a0..552b3b4f72 100644 --- a/src/bin/sysinfo.cpp +++ b/src/bin/sysinfo.cpp @@ -686,13 +686,13 @@ dump_cpus(system_info *info) static void dump_mem(system_info *info) { - printf("%10" B_PRIu32 " bytes free (used/max %10" B_PRIu32 " / %10" - B_PRIu32 ")\n", - B_PAGE_SIZE * (uint32)(info->max_pages - info->used_pages), - B_PAGE_SIZE * (uint32)info->used_pages, - B_PAGE_SIZE * (uint32)info->max_pages); - printf(" (cached %10" B_PRIu32 ")\n", - B_PAGE_SIZE * (uint32)info->cached_pages); + printf("%10" B_PRIu64 " bytes free (used/max %10" B_PRIu64 " / %10" + B_PRIu64 ")\n", + B_PAGE_SIZE * (uint64)(info->max_pages - info->used_pages), + B_PAGE_SIZE * (uint64)info->used_pages, + B_PAGE_SIZE * (uint64)info->max_pages); + printf(" (cached %10" B_PRIu64 ")\n", + B_PAGE_SIZE * (uint64)info->cached_pages); }