summaryrefslogtreecommitdiffstats
path: root/cc/util.h
diff options
context:
space:
mode:
authorccameron@chromium.org <ccameron@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-08 06:24:28 +0000
committerccameron@chromium.org <ccameron@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-08 06:24:28 +0000
commitd3afa1118465dff80232d36b7452700c43997d57 (patch)
tree6533e98e8935fc64c3c45b9174b65b88996f965b /cc/util.h
parent3639b07133f3c9a2b0e3dc8ae92bb7f2f0bd9a8d (diff)
downloadchromium_src-d3afa1118465dff80232d36b7452700c43997d57.zip
chromium_src-d3afa1118465dff80232d36b7452700c43997d57.tar.gz
chromium_src-d3afa1118465dff80232d36b7452700c43997d57.tar.bz2
Round managed memory stats to the nearest 8MB, and don't perform
redundant updates, to avoid frequently descheduling the renderer. BUG=164947 Review URL: https://chromiumcodereview.appspot.com/11470024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@171949 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/util.h')
-rw-r--r--cc/util.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/cc/util.h b/cc/util.h
new file mode 100644
index 0000000..6da3a69
--- /dev/null
+++ b/cc/util.h
@@ -0,0 +1,18 @@
+// Copyright 2012 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.
+
+#ifndef CC_UTIL_H_
+#define CC_UTIL_H_
+
+namespace cc {
+
+template<typename T>
+T RoundUp(T n, T mul)
+{
+ return ((n + mul - 1) / mul) * mul;
+}
+
+} // namespace cc
+
+#endif // CC_UTIL_H_