Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1045)

Unified Diff: base/sys_info_linux.cc

Issue 10113009: Set Android/V8 memory limits from dalvik.vm.heapsize. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add comment about highUsageDeltaMB. Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/sys_info.h ('k') | webkit/glue/webkitplatformsupport_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/sys_info_linux.cc
diff --git a/base/sys_info_linux.cc b/base/sys_info_linux.cc
index 03fdac28e58c9326eec145774544d0a2bd585575..7feb953d140d7a050314d831d478ced02bf69149 100644
--- a/base/sys_info_linux.cc
+++ b/base/sys_info_linux.cc
@@ -7,11 +7,24 @@
#include <limits>
#include "base/file_util.h"
+#include "base/lazy_instance.h"
#include "base/logging.h"
#include "base/string_number_conversions.h"
+#if defined(OS_ANDROID)
+#include "base/android/dalvik_heap_size.h"
+#endif
namespace base {
+#if defined(OS_ANDROID)
+static base::LazyInstance<android::DalvikHeapSize> g_dalvik_heap_size =
darin (slow to review) 2012/05/16 23:55:03 nit: shouldn't this be in a sys_info_android.cc fi
ulan 2012/05/18 10:24:06 Done. I am not sure if __system_property_get is t
+ LAZY_INSTANCE_INITIALIZER;
+
+int SysInfo::DalvikHeapSizeMB() {
+ return g_dalvik_heap_size.Get().HeapSizeMB();
+}
+#endif
+
int64 SysInfo::AmountOfPhysicalMemory() {
long pages = sysconf(_SC_PHYS_PAGES);
long page_size = sysconf(_SC_PAGE_SIZE);
« no previous file with comments | « base/sys_info.h ('k') | webkit/glue/webkitplatformsupport_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698