// Copyright (c) 2008 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "base/sys_info.h" #include #include "base/logging.h" namespace base { // static int SysInfo::NumberOfProcessors() { SYSTEM_INFO info; GetSystemInfo(&info); return static_cast(info.dwNumberOfProcessors); } // static int64 SysInfo::AmountOfPhysicalMemory() { MEMORYSTATUSEX memory_info; memory_info.dwLength = sizeof(memory_info); if (!GlobalMemoryStatusEx(&memory_info)) { NOTREACHED(); return 0; } return static_cast(memory_info.ullTotalPhys); } } // namespace base