summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 91d7bff)
raw | patch | inline | side by side (parent: 91d7bff)
author | Florian Forster <octo@huhu.verplant.org> | |
Mon, 14 Dec 2009 16:58:55 +0000 (17:58 +0100) | ||
committer | Florian Forster <octo@huhu.verplant.org> | |
Tue, 15 Dec 2009 12:00:02 +0000 (13:00 +0100) |
src/memory.c | patch | blob | history |
diff --git a/src/memory.c b/src/memory.c
index ecaa0c099b86e6e4959a19ba3674be53750ef779..b79a74b7cb42a307916eef911dbba3a968ac456a 100644 (file)
--- a/src/memory.c
+++ b/src/memory.c
vm_statistics_data_t vm_data;
mach_msg_type_number_t vm_data_len;
- long long wired;
- long long active;
- long long inactive;
- long long free;
+ gauge_t wired;
+ gauge_t active;
+ gauge_t inactive;
+ gauge_t free;
if (!port_host || !pagesize)
return (-1);
* This memory is not being used.
*/
- wired = vm_data.wire_count * pagesize;
- active = vm_data.active_count * pagesize;
- inactive = vm_data.inactive_count * pagesize;
- free = vm_data.free_count * pagesize;
+ wired = (gauge_t) (((uint64_t) vm_data.wire_count) * ((uint64_t) pagesize));
+ active = (gauge_t) (((uint64_t) vm_data.active_count) * ((uint64_t) pagesize));
+ inactive = (gauge_t) (((uint64_t) vm_data.inactive_count) * ((uint64_t) pagesize));
+ free = (gauge_t) (((uint64_t) vm_data.free_count) * ((uint64_t) pagesize));
memory_submit ("wired", wired);
memory_submit ("active", active);