fix for bug 21329,r=pnunn, Image cache needs to limit number as well as size of the image resources consumed on WIN95/WIN98

This commit is contained in:
neeti%netscape.com 2000-04-13 13:00:31 +00:00
parent 6656f5324e
commit fb486b0017

View File

@ -36,6 +36,7 @@
#include "xpcompat.h" //temporary, for timers
static PRUint32 image_cache_size;
static PRUint32 max_cache_items = 192;
PRLogModuleInfo *il_log_module = NULL;
ilISystemServices *il_ss = NULL;
@ -775,7 +776,13 @@ void
il_reduce_image_cache_size_to(PRUint32 new_size)
{
int32 last_size = 0;
int32 last_num_items = 0;
while ((il_cache.items > (int32)max_cache_items) && (il_cache.items != last_num_items)) {
last_num_items = il_cache.items;
IL_ShrinkCache();
}
while ((il_cache.bytes > (int32)new_size) && (il_cache.bytes != last_size)) {
last_size = il_cache.bytes;
IL_ShrinkCache();