summaryrefslogtreecommitdiff
path: root/src/image.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/image.c')
-rw-r--r--src/image.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/image.c b/src/image.c
index f71ba211d44..8d969a6f9c6 100644
--- a/src/image.c
+++ b/src/image.c
@@ -1360,14 +1360,12 @@ static void cache_image (struct frame *f, struct image *img);
struct image_cache *
make_image_cache (void)
{
- struct image_cache *c = xzalloc (sizeof *c);
- int size;
-
- size = 50;
- c->images = xmalloc (size * sizeof *c->images);
- c->size = size;
- size = IMAGE_CACHE_BUCKETS_SIZE * sizeof *c->buckets;
- c->buckets = xzalloc (size);
+ struct image_cache *c = xmalloc (sizeof *c);
+
+ c->size = 50;
+ c->used = c->refcount = 0;
+ c->images = xmalloc (c->size * sizeof *c->images);
+ c->buckets = xzalloc (IMAGE_CACHE_BUCKETS_SIZE * sizeof *c->buckets);
return c;
}