]> git.saurik.com Git - wxWidgets.git/commitdiff
fixed overflow when using sysconf() to retrieve free memory (bug 1524157)
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 11 Mar 2007 01:20:59 +0000 (01:20 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 11 Mar 2007 01:20:59 +0000 (01:20 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@44748 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/unix/utilsunx.cpp

index c64721bafbd705b14368ae01e27ccc816f7b92ff..3688288505735f3cd0404c916d4c644176509fa2 100644 (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