There should only be one way to get the system memory size.
authorakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 23 Apr 2015 08:22:13 +0000 (08:22 +0000)
committerakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 23 Apr 2015 08:22:13 +0000 (08:22 +0000)
commit2369269b0fb8ec174b2b59dd57292e410f3d74c6
treee7f69666d8c5f62e1132e466ff57a020fbd78d67
parentc598f186798835a54c62ed01257f5e48716cd9d3
There should only be one way to get the system memory size.
<https://webkit.org/b/144081>

Reviewed by Antti Koivisto.

Source/WebKit/mac:

* Misc/WebKitSystemBits.h:
* Misc/WebKitSystemBits.m:
(WebMemorySize): Deleted.
* WebView/WebView.mm:
(+[WebView _setCacheModel:]):
(roundUpToPowerOf2): Deleted.

Source/WebKit/win:

* WebView.cpp:
(WebView::setCacheModel):

Source/WebKit2:

* NetworkProcess/cocoa/NetworkProcessCocoa.mm:
(WebKit::NetworkProcess::platformSetCacheModel):
(WebKit::memorySize): Deleted.
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::platformSetCacheModel):
(WebKit::memorySize): Deleted.

Source/WTF:

Merge all the logic from other RAM size fetcher helpers into WTF's.

Darwin ports now use host_info() instead of sysctl(), since that was the more common way
of doing this.

Also bumped the fallback answer from 128 MB to 512 MB to bring it closer to today's hardware.

Finally, the number is rounded up to the next multiple of 128 MB, to avoid misunderstandings
on some systems where the number returned by the kernel is slightly lower than the marketing
number. Removed the "fudging" that was used in some places, since this fixes that cleanly.

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

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@183181 268f45cc-cd09-0410-ab3c-d52691b4dbfc
15 files changed:
Source/WTF/ChangeLog
Source/WTF/wtf/RAMSize.cpp
Source/WebCore/platform/audio/ios/MediaSessionManagerIOS.mm
Source/WebCore/platform/ios/LegacyTileCache.mm
Source/WebCore/platform/ios/SystemMemory.h
Source/WebCore/platform/ios/SystemMemoryIOS.cpp
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/Misc/WebKitSystemBits.h
Source/WebKit/mac/Misc/WebKitSystemBits.m
Source/WebKit/mac/WebView/WebView.mm
Source/WebKit/win/ChangeLog
Source/WebKit/win/WebView.cpp
Source/WebKit2/ChangeLog
Source/WebKit2/NetworkProcess/cocoa/NetworkProcessCocoa.mm
Source/WebKit2/WebProcess/cocoa/WebProcessCocoa.mm