summaryrefslogtreecommitdiffstats
path: root/base/sys_info.h
diff options
context:
space:
mode:
authorjochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-08 23:19:16 +0000
committerjochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-08 23:19:16 +0000
commit275a29deaf8a70834e4c5dc7d2f9458bedd80154 (patch)
treeabd2741729a3d672a83b45043227331c45f754bc /base/sys_info.h
parent2993010b5f527912cea918a16fad4cc7b5ded5dc (diff)
downloadchromium_src-275a29deaf8a70834e4c5dc7d2f9458bedd80154.zip
chromium_src-275a29deaf8a70834e4c5dc7d2f9458bedd80154.tar.gz
chromium_src-275a29deaf8a70834e4c5dc7d2f9458bedd80154.tar.bz2
Expose the virtual memory limit to blink
V8 queries the limit before sandbox initialization via static initializers. We should pass it in like the other memory related values instead. BUG=none R=mark@chromium.org Review URL: https://codereview.chromium.org/227113011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@262544 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/sys_info.h')
-rw-r--r--base/sys_info.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/base/sys_info.h b/base/sys_info.h
index aa40cad..7ce4e65 100644
--- a/base/sys_info.h
+++ b/base/sys_info.h
@@ -28,11 +28,22 @@ class BASE_EXPORT SysInfo {
// machine.
static int64 AmountOfAvailablePhysicalMemory();
+ // Return the number of bytes of virtual memory of this process. A return
+ // value of zero means that there is no limit on the available virtual
+ // memory.
+ static int64 AmountOfVirtualMemory();
+
// Return the number of megabytes of physical memory on the current machine.
static int AmountOfPhysicalMemoryMB() {
return static_cast<int>(AmountOfPhysicalMemory() / 1024 / 1024);
}
+ // Return the number of megabytes of available virtual memory, or zero if it
+ // is unlimited.
+ static int AmountOfVirtualMemoryMB() {
+ return static_cast<int>(AmountOfVirtualMemory() / 1024 / 1024);
+ }
+
// Return the available disk space in bytes on the volume containing |path|,
// or -1 on failure.
static int64 AmountOfFreeDiskSpace(const FilePath& path);