From 2d33a8f85a83ceaf55dd5ab6a9e363191bfe3c08 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Sat, 10 Sep 2011 00:55:39 +0000 Subject: Make high level cache, low level cache and image cache all be initialised from passed parameters Calculate all cache sizes from single memory cache size option and sanity check have a single global struct to hold all parameters instead of several individual variables svn path=/trunk/netsurf/; revision=12784 --- image/image_cache.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'image/image_cache.c') diff --git a/image/image_cache.c b/image/image_cache.c index a9f810426..f09db2d66 100644 --- a/image/image_cache.c +++ b/image/image_cache.c @@ -89,20 +89,20 @@ struct image_cache_s { /** Maximum count of bitmaps allocated at any one time */ int max_bitmap_count; - /** The size of the bitmaps when teh max count occoured */ + /** The size of the bitmaps when the max count occoured */ size_t max_bitmap_count_size; /** Bitmap was not available at plot time required conversion */ int miss_count; - size_t miss_size; + uint64_t miss_size; /** Bitmap was available at plot time required no conversion */ int hit_count; - size_t hit_size; + uint64_t hit_size; /** Bitmap was not available at plot time and required * conversion which failed. */ int fail_count; - size_t fail_size; + uint64_t fail_size; /* Cache entry freed without ever being redrawn */ int total_unrendered; @@ -120,6 +120,7 @@ struct image_cache_s { unsigned int peak_conversions_size; }; +/** image cache state */ static struct image_cache_s *image_cache = NULL; @@ -357,6 +358,9 @@ image_cache_init(const struct image_cache_parameters *image_cache_parameters) image_cache__background_update, image_cache); + LOG(("Image cache initilised with a limit of %d hysteresis of %d", + image_cache->params.limit, image_cache->params.hysteresis)); + return NSERROR_OK; } -- cgit v1.2.3