diff options
author | deanm@chromium.org <deanm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-18 12:18:14 +0000 |
---|---|---|
committer | deanm@chromium.org <deanm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-18 12:18:14 +0000 |
commit | fadf97f2f16f6b3ad2756cd07657c4f47172da92 (patch) | |
tree | ba24cf444ef2696e32639d51ef30e9f0d96df330 /base/sys_info.h | |
parent | 1918c4e12cea21c56d5d9e07f3759de6ad9e3dd3 (diff) | |
download | chromium_src-fadf97f2f16f6b3ad2756cd07657c4f47172da92.zip chromium_src-fadf97f2f16f6b3ad2756cd07657c4f47172da92.tar.gz chromium_src-fadf97f2f16f6b3ad2756cd07657c4f47172da92.tar.bz2 |
Add cross platform base::SysInfo::AmountOfPhysicalMemoryMB to replace the Windows only env_util::GetPhysicalMemoryMB.
From Seo Sanghyeon.
Review URL: http://codereview.chromium.org/2962
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2358 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/sys_info.h')
-rw-r--r-- | base/sys_info.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/base/sys_info.h b/base/sys_info.h index c82b0d3..01e506c 100644 --- a/base/sys_info.h +++ b/base/sys_info.h @@ -16,6 +16,11 @@ class SysInfo { // Return the number of bytes of physical memory on the current machine. static int64 AmountOfPhysicalMemory(); + + // Return the number of megabytes of physical memory on the current machine. + static int AmountOfPhysicalMemoryMB() { + return static_cast<int>(AmountOfPhysicalMemory() / 1024 / 1024); + } }; } // namespace base |