[BlackBerry] Implement computeRAMSize for QNX
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 14 Jun 2012 23:00:02 +0000 (23:00 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 14 Jun 2012 23:00:02 +0000 (23:00 +0000)
https://bugs.webkit.org/show_bug.cgi?id=89110

Patch by Yong Li <yoli@rim.com> on 2012-06-14
Reviewed by Rob Buis.

* wtf/RAMSize.cpp:
(WTF::computeRAMSize):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@120368 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WTF/ChangeLog
Source/WTF/wtf/RAMSize.cpp

index 06ac010..1954112 100644 (file)
@@ -1,3 +1,13 @@
+2012-06-14  Yong Li  <yoli@rim.com>
+
+        [BlackBerry] Implement computeRAMSize for QNX
+        https://bugs.webkit.org/show_bug.cgi?id=89110
+
+        Reviewed by Rob Buis.
+
+        * wtf/RAMSize.cpp:
+        (WTF::computeRAMSize):
+
 2012-06-14  Geoffrey Garen  <ggaren@apple.com>
 
         ARMv7 should support spinlocks
index 50b5222..5b2cc67 100644 (file)
@@ -35,6 +35,8 @@
 #include <unistd.h>
 #elif OS(WINDOWS)
 #include <windows.h>
+#elif OS(QNX)
+#include <sys/stat.h>
 #endif
 
 namespace WTF {
@@ -75,6 +77,11 @@ static size_t computeRAMSize()
     if (!result)
         return ramSizeGuess;
     return status.ullTotalPhys;
+#elif OS(QNX)
+    struct stat mst;
+    if (stat("/proc", &mst))
+        return ramSizeGuess;
+    return mst.st_size;
 #endif
 }