summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwtc%google.com <devnull@localhost>2008-10-07 18:04:30 +0000
committerwtc%google.com <devnull@localhost>2008-10-07 18:04:30 +0000
commit22d9ec516ee1209db6847c4f29b9a9f07c50a75d (patch)
treef05801c9e585b446379a08eaec6fd0b19bb9f8fa
parentcc2f5c497a9ecc5bf4d530d27c79451d13dd6612 (diff)
downloadnspr-hg-22d9ec516ee1209db6847c4f29b9a9f07c50a75d.tar.gz
Bug 454878: Need to initialize 'count' to the size of the host_basic_info
structure before calling host_info. Use max_mem (64-bit) instead of memory_size (32-bit), which is capped at 2GB. The patch is contributed by Josh Aas <joshmoz@gmail.com>. r=bzbarsky,wtc.
-rw-r--r--pr/src/misc/prsystem.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/pr/src/misc/prsystem.c b/pr/src/misc/prsystem.c
index 8ccdff84..dc4f158d 100644
--- a/pr/src/misc/prsystem.c
+++ b/pr/src/misc/prsystem.c
@@ -300,14 +300,14 @@ PR_IMPLEMENT(PRUint64) PR_GetPhysicalMemorySize(void)
#elif defined(DARWIN)
struct host_basic_info hInfo;
- mach_msg_type_number_t count;
+ mach_msg_type_number_t count = sizeof(hInfo);
int result = host_info(mach_host_self(),
HOST_BASIC_INFO,
(host_info_t) &hInfo,
&count);
if (result == KERN_SUCCESS)
- bytes = hInfo.memory_size;
+ bytes = hInfo.max_mem;
#elif defined(WIN32)