diff options
Diffstat (limited to 'desktop/netsurf.c')
-rw-r--r-- | desktop/netsurf.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/desktop/netsurf.c b/desktop/netsurf.c index 547365b7c..bd785898f 100644 --- a/desktop/netsurf.c +++ b/desktop/netsurf.c @@ -28,6 +28,8 @@ #include "netsurf/inttypes.h" #include "utils/config.h" +#include "utils/errors.h" +#include "utils/nscolour.h" #include "utils/nsoption.h" #include "utils/corestrings.h" #include "utils/log.h" @@ -97,7 +99,7 @@ static void netsurf_lwc_iterator(lwc_string *str, void *pw) { - NSLOG(netsurf, WARNING, "[%3u] %.*s", str->refcnt, + NSLOG(netsurf, WARNING, "[%3"PRIu32"] %.*s", str->refcnt, (int)lwc_string_length(str), lwc_string_data(str)); } @@ -135,6 +137,10 @@ nserror netsurf_init(const char *store_path) if (ret != NSERROR_OK) return ret; + ret = nscolour_update(); + if (ret != NSERROR_OK) + return ret; + /* set up cache limits based on the memory cache size option */ hlcache_parameters.llcache.limit = nsoption_int(memory_cache_size); @@ -149,10 +155,10 @@ nserror netsurf_init(const char *store_path) hlcache_parameters.llcache.fetch_attempts = nsoption_uint(max_retried_fetches); /* image cache is 25% of total memory cache size */ - image_cache_parameters.limit = (hlcache_parameters.llcache.limit * 25) / 100; + image_cache_parameters.limit = hlcache_parameters.llcache.limit / 4; /* image cache hysteresis is 20% of the image cache size */ - image_cache_parameters.hysteresis = (image_cache_parameters.limit * 20) / 100; + image_cache_parameters.hysteresis = image_cache_parameters.limit / 5; /* account for image cache use from total */ hlcache_parameters.llcache.limit -= image_cache_parameters.limit; @@ -161,7 +167,7 @@ nserror netsurf_init(const char *store_path) hlcache_parameters.llcache.store.limit = nsoption_uint(disc_cache_size); /* set backing store hysterissi to 20% */ - hlcache_parameters.llcache.store.hysteresis = (hlcache_parameters.llcache.store.limit * 20) / 100;; + hlcache_parameters.llcache.store.hysteresis = hlcache_parameters.llcache.store.limit / 5; /* set the path to the backing store */ hlcache_parameters.llcache.store.path = |