mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-09 16:57:36 +00:00
bug 454587 Make sure that don't disable memory cache when
PR_GetPhysicalMemory() fails. Instead, default to 32 MB of memory (2 MB cache size) r+sr=bz
This commit is contained in:
parent
84837afd35
commit
61ce0471a4
7
netwerk/cache/src/nsCacheService.cpp
vendored
7
netwerk/cache/src/nsCacheService.cpp
vendored
@ -526,8 +526,11 @@ nsCacheProfilePrefObserver::MemoryCacheCapacity()
|
||||
PRUint64 bytes = PR_GetPhysicalMemorySize();
|
||||
CACHE_LOG_DEBUG(("Physical Memory size is %llu\n", bytes));
|
||||
|
||||
if (LL_CMP(bytes, ==, LL_ZERO))
|
||||
return 0;
|
||||
// If getting the physical memory failed, arbitrarily assume
|
||||
// 32 MB of RAM. We use a low default to have a reasonable
|
||||
// size on all the devices we support.
|
||||
if (bytes == 0)
|
||||
bytes = 32 * 1024 * 1024;
|
||||
|
||||
// Conversion from unsigned int64 to double doesn't work on all platforms.
|
||||
// We need to truncate the value at LL_MAXINT to make sure we don't
|
||||
|
Loading…
x
Reference in New Issue
Block a user