summaryrefslogtreecommitdiff
path: root/src/image.c
diff options
context:
space:
mode:
authorDmitry Antipov <dmantipov@yandex.ru>2013-08-15 09:23:40 +0400
committerDmitry Antipov <dmantipov@yandex.ru>2013-08-15 09:23:40 +0400
commit9c25330708e49ddaeb71f16a65cdc1b51be2a27d (patch)
tree0d03865094f5189816fccdff2248a22761713a50 /src/image.c
parent05e64f9f63f98108bb04f8ab45343e507862d8f4 (diff)
downloademacs-9c25330708e49ddaeb71f16a65cdc1b51be2a27d.tar.gz
emacs-9c25330708e49ddaeb71f16a65cdc1b51be2a27d.tar.bz2
emacs-9c25330708e49ddaeb71f16a65cdc1b51be2a27d.zip
* term.c (get_named_tty, create_tty_output, tty_free_frame_resources)
(tty_free_frame_resources, delete_tty): Prefer eassert to emacs_abort. * image.c (make_image_cache): For struct image_cache, prefer xmalloc to xzalloc and so avoid redundant call to memset. * xterm.c (x_term_init): Avoid unnecessary initializations of dpyinfo members because it is allocated with xzalloc and so already zeroed.
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;
}