SH-4641 FIX Interesting: Incorrect amount of system memory detected on Mac

meow-7.2.2
Richard Linden 2013-12-03 20:27:41 -08:00
parent 3cb64c5038
commit f7dc3937cd
1 changed files with 3 additions and 3 deletions

View File

@ -899,17 +899,17 @@ U32Kilobytes LLMemoryInfo::getPhysicalMemoryKB() const
size_t len = sizeof(phys);
sysctl(mib, 2, &phys, &len, NULL, 0);
return U32Bytes(llmin(phys, (U64)U32_MAX));
return U64Bytes(phys);
#elif LL_LINUX
U64 phys = 0;
phys = (U64)(getpagesize()) * (U64)(get_phys_pages());
return U32Bytes(llmin(phys, (U64)U32_MAX));
return U64Bytes(phys);
#elif LL_SOLARIS
U64 phys = 0;
phys = (U64)(getpagesize()) * (U64)(sysconf(_SC_PHYS_PAGES));
return U32Bytes(llmin(phys, (U64)U32_MAX));
return U64Bytes(phys);
#else
return 0;