From 73786be789262f72114030ccba586d898184a1ba Mon Sep 17 00:00:00 2001 From: "pliard@chromium.org" Date: Wed, 25 Dec 2013 18:24:46 +0000 Subject: Make size of ashmem regions based on device's physical memory. Ashmem regions created by the ashmem allocator used to be fixed to 32 MBytes which can be a little small for high-end devices. This change makes the allocator create ashmem regions of those sizes: - 64 MBytes for 512 MBytes devices - 128 MBytes for 1 GByte devices - 256 MBytes for 2 GBytes... This also adds an error code path in case ashmem creation fails which may happen if the address space is too fragmented. In this case the allocator repetitively retries by dividing the ashmem region size by 2 until the ashmem region reaches 32 MBytes (which is the minimum). TBR=bulach@chromium.org Review URL: https://codereview.chromium.org/119923002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@242497 0039d316-1c4b-4281-b951-d872f2087c98 --- base/android/sys_utils.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'base/android/sys_utils.h') diff --git a/base/android/sys_utils.h b/base/android/sys_utils.h index 9b3152b..0841d0a 100644 --- a/base/android/sys_utils.h +++ b/base/android/sys_utils.h @@ -17,7 +17,7 @@ class BASE_EXPORT SysUtils { // Returns true iff this is a low-end device. static bool IsLowEndDevice(); - // Return the device's RAM size in kilo-bytes. Used for testing. + // Return the device's RAM size in kilo-bytes. static size_t AmountOfPhysicalMemoryKB(); private: -- cgit v1.1