diff options
author | Vincent Sanders <vince@netsurf-browser.org> | 2011-09-10 00:55:39 +0000 |
---|---|---|
committer | Vincent Sanders <vince@netsurf-browser.org> | 2011-09-10 00:55:39 +0000 |
commit | 2d33a8f85a83ceaf55dd5ab6a9e363191bfe3c08 (patch) | |
tree | c470aa1525dc7835bf2918ccab4138f956f7f828 /image/image_cache.c | |
parent | cbeffd4c5f4ac2ecbb2cfc97a705441a20ec8f23 (diff) | |
download | netsurf-2d33a8f85a83ceaf55dd5ab6a9e363191bfe3c08.tar.gz netsurf-2d33a8f85a83ceaf55dd5ab6a9e363191bfe3c08.tar.bz2 |
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
Diffstat (limited to 'image/image_cache.c')
-rw-r--r-- | image/image_cache.c | 12 |
1 files changed, 8 insertions, 4 deletions
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; } |