diff options
Diffstat (limited to 'base')
-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 |