summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
authoragl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-22 01:42:15 +0000
committeragl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-22 01:42:15 +0000
commit037fce0cedc970c9964165e741b8d015f3897717 (patch)
tree549fd59b27e173dd336ed487aeed8e3902719916 /base
parent0ba1f530cf1dfac50ddb7d3b9ef34f2a753947c4 (diff)
downloadchromium_src-037fce0cedc970c9964165e741b8d015f3897717.zip
chromium_src-037fce0cedc970c9964165e741b8d015f3897717.tar.gz
chromium_src-037fce0cedc970c9964165e741b8d015f3897717.tar.bz2
POSIX: Porting renderer/render_process.cc, low hanging fruit
Review URL: http://codereview.chromium.org/18622 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8436 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r--base/sys_info.h4
-rw-r--r--base/sys_info_posix.cc5
-rw-r--r--base/sys_info_win.cc8
3 files changed, 17 insertions, 0 deletions
diff --git a/base/sys_info.h b/base/sys_info.h
index a70f5b6..46029cc 100644
--- a/base/sys_info.h
+++ b/base/sys_info.h
@@ -53,6 +53,10 @@ class SysInfo {
// Return the number of displays.
static int DisplayCount();
+
+ // Return the smallest amount of memory (in bytes) which the VM system will
+ // allocate.
+ static size_t VMAllocationGranularity();
};
} // namespace base
diff --git a/base/sys_info_posix.cc b/base/sys_info_posix.cc
index b39457d..9ea3cab 100644
--- a/base/sys_info_posix.cc
+++ b/base/sys_info_posix.cc
@@ -129,4 +129,9 @@ int SysInfo::DisplayCount() {
return 1;
}
+// static
+size_t SysInfo::VMAllocationGranularity() {
+ return getpagesize();
+}
+
} // namespace base
diff --git a/base/sys_info_win.cc b/base/sys_info_win.cc
index 4d52c4a..7690e81a 100644
--- a/base/sys_info_win.cc
+++ b/base/sys_info_win.cc
@@ -100,4 +100,12 @@ int SysInfo::DisplayCount() {
return GetSystemMetrics(SM_CMONITORS);
}
+// static
+size_t SysInfo::VMAllocationGranularity() {
+ SYSTEM_INFO sysinfo;
+ GetSystemInfo(&info);
+
+ return info.dwAllocationGranularity;
+}
+
} // namespace base