diff options
| author | pliard@chromium.org <pliard@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-25 18:24:46 +0000 |
|---|---|---|
| committer | pliard@chromium.org <pliard@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-25 18:24:46 +0000 |
| commit | 73786be789262f72114030ccba586d898184a1ba (patch) | |
| tree | 0394c9d8d3eb09d49ede314b742120f7ee470f32 /base/android/sys_utils.h | |
| parent | ad65a3ee540552ecca50ebbf9382f1a4c718d383 (diff) | |
| download | chromium_src-73786be789262f72114030ccba586d898184a1ba.zip chromium_src-73786be789262f72114030ccba586d898184a1ba.tar.gz chromium_src-73786be789262f72114030ccba586d898184a1ba.tar.bz2 | |
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
Diffstat (limited to 'base/android/sys_utils.h')
| -rw-r--r-- | base/android/sys_utils.h | 2 |
1 files changed, 1 insertions, 1 deletions
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: |
