mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1038897: pop entries off the cache until its size reaches max cache size. Input read from corresponding pref is clamped to non-negative values (r=seth)
This commit is contained in:
parent
73801da33e
commit
ca277145d5
@ -1031,6 +1031,7 @@ void imgLoader::GlobalInit()
|
||||
sCacheMaxSize = cachesize;
|
||||
else
|
||||
sCacheMaxSize = 5 * 1024 * 1024;
|
||||
sCacheMaxSize = sCacheMaxSize > 0 ? sCacheMaxSize : 0;
|
||||
|
||||
sMemReporter = new imgMemoryReporter();
|
||||
RegisterStrongMemoryReporter(sMemReporter);
|
||||
@ -1305,8 +1306,8 @@ void imgLoader::CheckCacheLimits(imgCacheTable &cache, imgCacheQueue &queue)
|
||||
NS_ASSERTION(queue.GetSize() == 0,
|
||||
"imgLoader::CheckCacheLimits -- incorrect cache size");
|
||||
|
||||
// Remove entries from the cache until we're back under our desired size.
|
||||
while (queue.GetSize() >= sCacheMaxSize) {
|
||||
// Remove entries from the cache until we're back at our desired max size.
|
||||
while (queue.GetSize() > sCacheMaxSize) {
|
||||
// Remove the first entry in the queue.
|
||||
nsRefPtr<imgCacheEntry> entry(queue.Pop());
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user