The patch limits the amount of memory Emacs may use for an image-cache. This if what my users want and it means I don't have to implement it in Lisp. So, given the cache has still vacancy left, I can preload not yet displayed images into it knowing they stay there. Using the existing time-based mechanism doesn't really work here: Either the limit is to short and thus pre-loaded images are evicted before they can be displayed. Or it is to long and the image-cache becomes undesirable large.
---
I use data-strings as basis for the image-descriptor, rather than files. In some scenarios multiple descriptor share their image-data. Since images can't be flushed based on the data property (as opposed to the file one), I would have to keep track of these dependencies between descriptor and data, since my own cache stores these data strings and not the actual images.
Andreas