summaryrefslogtreecommitdiff
path: root/src/cairo-array.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2008-11-18 17:26:55 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2008-11-29 11:20:34 +0000
commite6963a5bfebda69a1ef0a986cede84bcd955b6d4 (patch)
treea70bd8d15c60a71ba88bdf299244f93aa7b147d0 /src/cairo-array.c
parentd1801c23fae3777c7c59e084894a3410f7a1f932 (diff)
Mark allocation failures as unlikely.
Use the gcc likelihood annotation to indicate that allocation failures are extremely unlikely.
Diffstat (limited to 'src/cairo-array.c')
-rw-r--r--src/cairo-array.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cairo-array.c b/src/cairo-array.c
index ef50684f..9c084b9e 100644
--- a/src/cairo-array.c
+++ b/src/cairo-array.c
@@ -138,7 +138,7 @@ _cairo_array_grow_by (cairo_array_t *array, unsigned int additional)
if (array->elements == NULL) {
array->elements = malloc (sizeof (char *));
- if (array->elements == NULL)
+ if (unlikely (array->elements == NULL))
return _cairo_error (CAIRO_STATUS_NO_MEMORY);
*array->elements = NULL;
@@ -148,7 +148,7 @@ _cairo_array_grow_by (cairo_array_t *array, unsigned int additional)
new_elements = _cairo_realloc_ab (*array->elements,
array->size, array->element_size);
- if (new_elements == NULL) {
+ if (unlikely (new_elements == NULL)) {
array->size = old_size;
return _cairo_error (CAIRO_STATUS_NO_MEMORY);
}