Gitweb links:

...log 
http://git.netsurf-browser.org/netsurf.git/shortlog/40acd620b50f9cc81305c564cee45cbb3de880f9
...commit 
http://git.netsurf-browser.org/netsurf.git/commit/40acd620b50f9cc81305c564cee45cbb3de880f9
...tree 
http://git.netsurf-browser.org/netsurf.git/tree/40acd620b50f9cc81305c564cee45cbb3de880f9

The branch, master has been updated
       via  40acd620b50f9cc81305c564cee45cbb3de880f9 (commit)
      from  c6eea438ac6698f60bc4c7f1d490db1c599f5488 (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=40acd620b50f9cc81305c564cee45cbb3de880f9
commit 40acd620b50f9cc81305c564cee45cbb3de880f9
Author: Vincent Sanders <[email protected]>
Commit: Vincent Sanders <[email protected]>

    Ensure image cache logging does not cause division by zero at exit

diff --git a/content/handlers/image/image_cache.c 
b/content/handlers/image/image_cache.c
index 6ce6b52..ae53192 100644
--- a/content/handlers/image/image_cache.c
+++ b/content/handlers/image/image_cache.c
@@ -438,6 +438,7 @@ image_cache_init(const struct image_cache_parameters 
*image_cache_parameters)
 nserror image_cache_fini(void)
 {
        unsigned int op_count;
+       uint64_t op_size;
 
        guit->misc->schedule(-1, image_cache__background_update, image_cache);
 
@@ -452,6 +453,10 @@ nserror image_cache_fini(void)
                image_cache->miss_count +
                image_cache->fail_count;
 
+       op_size = image_cache->hit_size +
+               image_cache->miss_size +
+               image_cache->fail_size;
+
        NSLOG(netsurf, INFO, "Age %ds", image_cache->current_age / 1000);
        NSLOG(netsurf, INFO, "Peak size %"PRIsizet" (in %d)",
              image_cache->max_bitmap_size,
@@ -460,12 +465,7 @@ nserror image_cache_fini(void)
              image_cache->max_bitmap_count,
              image_cache->max_bitmap_count_size);
 
-       if (op_count > 0) {
-               uint64_t op_size;
-
-               op_size = image_cache->hit_size +
-                       image_cache->miss_size +
-                       image_cache->fail_size;
+       if ((op_count > 0) && (op_size >0)) {
 
                NSLOG(netsurf, INFO,
                      "Cache total/hit/miss/fail (counts) %d/%d/%d/%d 
(100%%/%d%%/%d%%/%d%%)",


-----------------------------------------------------------------------

Summary of changes:
 content/handlers/image/image_cache.c |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/content/handlers/image/image_cache.c 
b/content/handlers/image/image_cache.c
index 6ce6b52..ae53192 100644
--- a/content/handlers/image/image_cache.c
+++ b/content/handlers/image/image_cache.c
@@ -438,6 +438,7 @@ image_cache_init(const struct image_cache_parameters 
*image_cache_parameters)
 nserror image_cache_fini(void)
 {
        unsigned int op_count;
+       uint64_t op_size;
 
        guit->misc->schedule(-1, image_cache__background_update, image_cache);
 
@@ -452,6 +453,10 @@ nserror image_cache_fini(void)
                image_cache->miss_count +
                image_cache->fail_count;
 
+       op_size = image_cache->hit_size +
+               image_cache->miss_size +
+               image_cache->fail_size;
+
        NSLOG(netsurf, INFO, "Age %ds", image_cache->current_age / 1000);
        NSLOG(netsurf, INFO, "Peak size %"PRIsizet" (in %d)",
              image_cache->max_bitmap_size,
@@ -460,12 +465,7 @@ nserror image_cache_fini(void)
              image_cache->max_bitmap_count,
              image_cache->max_bitmap_count_size);
 
-       if (op_count > 0) {
-               uint64_t op_size;
-
-               op_size = image_cache->hit_size +
-                       image_cache->miss_size +
-                       image_cache->fail_size;
+       if ((op_count > 0) && (op_size >0)) {
 
                NSLOG(netsurf, INFO,
                      "Cache total/hit/miss/fail (counts) %d/%d/%d/%d 
(100%%/%d%%/%d%%/%d%%)",


-- 
NetSurf Browser
_______________________________________________
netsurf-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to