fixed overflow when using sysconf() to retrieve free memory (bug 1524157)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@44748 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2007-03-11 01:20:59 +00:00
parent 4ecdf8fc40
commit 40f00746d2

View File

@@ -994,12 +994,12 @@ wxMemorySize wxGetFreeMemory()
return (wxMemorySize)memFree;
}
#elif defined(__SUN__) && defined(_SC_AVPHYS_PAGES)
return (wxMemorySize)(sysconf(_SC_AVPHYS_PAGES)*sysconf(_SC_PAGESIZE));
#elif defined(__SGI__)
struct rminfo realmem;
if ( sysmp(MP_SAGET, MPSA_RMINFO, &realmem, sizeof realmem) == 0 )
return ((wxMemorySize)realmem.physmem * sysconf(_SC_PAGESIZE));
#elif defined(_SC_AVPHYS_PAGES)
return ((wxMemorySize)sysconf(_SC_AVPHYS_PAGES))*sysconf(_SC_PAGESIZE);
//#elif defined(__FREEBSD__) -- might use sysctl() to find it out, probably
#endif