diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2008-11-18 17:26:55 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2008-11-29 11:20:34 +0000 |
commit | e6963a5bfebda69a1ef0a986cede84bcd955b6d4 (patch) | |
tree | a70bd8d15c60a71ba88bdf299244f93aa7b147d0 /src/cairo-lzw.c | |
parent | d1801c23fae3777c7c59e084894a3410f7a1f932 (diff) | |
download | cairo-e6963a5bfebda69a1ef0a986cede84bcd955b6d4.tar.gz |
Mark allocation failures as unlikely.
Use the gcc likelihood annotation to indicate that allocation failures are
extremely unlikely.
Diffstat (limited to 'src/cairo-lzw.c')
-rw-r--r-- | src/cairo-lzw.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cairo-lzw.c b/src/cairo-lzw.c index c17917659..a4fdf738f 100644 --- a/src/cairo-lzw.c +++ b/src/cairo-lzw.c @@ -73,7 +73,7 @@ _lzw_buf_init (lzw_buf_t *buf, int size) buf->pending_bits = 0; buf->data = malloc (size); - if (buf->data == NULL) { + if (unlikely (buf->data == NULL)) { buf->data_size = 0; buf->status = _cairo_error (CAIRO_STATUS_NO_MEMORY); return; @@ -98,7 +98,7 @@ _lzw_buf_grow (lzw_buf_t *buf) if (new_size / 2 == buf->data_size) new_data = realloc (buf->data, new_size); - if (new_data == NULL) { + if (unlikely (new_data == NULL)) { free (buf->data); buf->data_size = 0; buf->status = _cairo_error (CAIRO_STATUS_NO_MEMORY); |