On Tue, Aug 13, 2013 at 10:47:29AM +0300, Alon Levy wrote: > diff --git a/server/spice_image_cache.h b/server/spice_image_cache.h > new file mode 100644 > index 0000000..f11cebc > --- /dev/null > +++ b/server/spice_image_cache.h > @@ -0,0 +1,39 @@ > +#ifndef H_SPICE_IMAGE_CACHE > +#define H_SPICE_IMAGE_CACHE > + > +#include <inttypes.h> > + > +#include "common/pixman_utils.h" > +#include "common/canvas_base.h" > + > +#include "common/ring.h" > + > +typedef struct ImageCacheItem { > + RingItem lru_link; > + uint64_t id; > +#ifdef IMAGE_CACHE_AGE > + uint32_t age; > +#endif > + struct ImageCacheItem *next; > + pixman_image_t *image; > +} ImageCacheItem; > + > +#define IMAGE_CACHE_HASH_SIZE 1024 > + > +typedef struct ImageCache { > + SpiceImageCache base; > + ImageCacheItem *hash_table[IMAGE_CACHE_HASH_SIZE]; > + Ring lru; > +#ifdef IMAGE_CACHE_AGE > + uint32_t age; > +#else > + uint32_t num_items; > +#endif > +} ImageCache; It seems it could even be possible to have an image_cache_new() function which allocates memory for a new ImageCache, which would allow to make the ImageCache/ImageCacheItem structures private (I only took a quick look so I may have missed fundamental issues that prevent that from being possible ;) Christophe
Attachment:
pgpgEcvgNsGfI.pgp
Description: PGP signature
_______________________________________________ Spice-devel mailing list Spice-devel@xxxxxxxxxxxxxxxxxxxxx http://lists.freedesktop.org/mailman/listinfo/spice-devel