1 // Copyright (c) 2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "base/sys_info.h"
9 #include "base/logging.h"
14 int SysInfo::NumberOfProcessors() {
17 return static_cast<int>(info
.dwNumberOfProcessors
);
21 int64
SysInfo::AmountOfPhysicalMemory() {
22 MEMORYSTATUSEX memory_info
;
23 memory_info
.dwLength
= sizeof(memory_info
);
24 if (!GlobalMemoryStatusEx(&memory_info
)) {
29 int64 rv
= static_cast<int64
>(memory_info
.ullTotalPhys
);
36 int64
SysInfo::AmountOfFreeDiskSpace(const std::wstring
& path
) {
37 ULARGE_INTEGER available
, total
, free
;
38 if (!GetDiskFreeSpaceExW(path
.c_str(), &available
, &total
, &free
)) {
41 int64 rv
= static_cast<int64
>(available
.QuadPart
);