Skip to content
Snippets Groups Projects
Commit f7dc3937 authored by Richard Linden's avatar Richard Linden
Browse files

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

parent 3cb64c50
No related branches found
No related tags found
No related merge requests found
...@@ -899,17 +899,17 @@ U32Kilobytes LLMemoryInfo::getPhysicalMemoryKB() const ...@@ -899,17 +899,17 @@ U32Kilobytes LLMemoryInfo::getPhysicalMemoryKB() const
size_t len = sizeof(phys); size_t len = sizeof(phys);
sysctl(mib, 2, &phys, &len, NULL, 0); sysctl(mib, 2, &phys, &len, NULL, 0);
return U32Bytes(llmin(phys, (U64)U32_MAX)); return U64Bytes(phys);
#elif LL_LINUX #elif LL_LINUX
U64 phys = 0; U64 phys = 0;
phys = (U64)(getpagesize()) * (U64)(get_phys_pages()); phys = (U64)(getpagesize()) * (U64)(get_phys_pages());
return U32Bytes(llmin(phys, (U64)U32_MAX)); return U64Bytes(phys);
#elif LL_SOLARIS #elif LL_SOLARIS
U64 phys = 0; U64 phys = 0;
phys = (U64)(getpagesize()) * (U64)(sysconf(_SC_PHYS_PAGES)); phys = (U64)(getpagesize()) * (U64)(sysconf(_SC_PHYS_PAGES));
return U32Bytes(llmin(phys, (U64)U32_MAX)); return U64Bytes(phys);
#else #else
return 0; return 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment