Gitweb links:
...log
http://git.netsurf-browser.org/netsurf.git/shortlog/da2aa05b730560024760a...
...commit
http://git.netsurf-browser.org/netsurf.git/commit/da2aa05b730560024760a25...
...tree
http://git.netsurf-browser.org/netsurf.git/tree/da2aa05b730560024760a25da...
The branch, master has been updated
via da2aa05b730560024760a25dabc2078f578efd10 (commit)
from 98496cdae16a9196bff930fff52e198a9856e2cb (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=da2aa05b73056002476...
commit da2aa05b730560024760a25dabc2078f578efd10
Author: Michael Drake <michael.drake(a)codethink.co.uk>
Commit: Michael Drake <michael.drake(a)codethink.co.uk>
Prevent overflow of disc cache hysteresis.
The default disc cache size is 1GB (1024 * 1024 * 1024).
On systems with 32bit size_t, the hysteresis calculation,
which multiplied 1GB by 20 would overflow, causing a zero
hysteresis.
(1024 * 1024 * 1024) * 20 % (2^32)
= 0
Thanks to Jonas Amoson for reporting.
diff --git a/desktop/netsurf.c b/desktop/netsurf.c
index 6cc3a11..fd838b8 100644
--- a/desktop/netsurf.c
+++ b/desktop/netsurf.c
@@ -155,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;
@@ -167,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 =
-----------------------------------------------------------------------
Summary of changes:
desktop/netsurf.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/desktop/netsurf.c b/desktop/netsurf.c
index 6cc3a11..fd838b8 100644
--- a/desktop/netsurf.c
+++ b/desktop/netsurf.c
@@ -155,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;
@@ -167,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 =
--
NetSurf Browser