summaryrefslogtreecommitdiff
path: root/src/cairo-path.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-path.c
parentd1801c23fae3777c7c59e084894a3410f7a1f932 (diff)
downloadcairo-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-path.c')
-rw-r--r--src/cairo-path.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/cairo-path.c b/src/cairo-path.c
index 855b85fef..84dfc0c45 100644
--- a/src/cairo-path.c
+++ b/src/cairo-path.c
@@ -302,7 +302,7 @@ _cairo_path_create_in_error (cairo_status_t status)
return (cairo_path_t*) &_cairo_path_nil;
path = malloc (sizeof (cairo_path_t));
- if (path == NULL) {
+ if (unlikely (path == NULL)) {
_cairo_error_throw (CAIRO_STATUS_NO_MEMORY);
return (cairo_path_t*) &_cairo_path_nil;
}
@@ -322,7 +322,7 @@ _cairo_path_create_internal (cairo_path_fixed_t *path_fixed,
cairo_path_t *path;
path = malloc (sizeof (cairo_path_t));
- if (path == NULL) {
+ if (unlikely (path == NULL)) {
_cairo_error_throw (CAIRO_STATUS_NO_MEMORY);
return (cairo_path_t*) &_cairo_path_nil;
}
@@ -337,8 +337,8 @@ _cairo_path_create_internal (cairo_path_fixed_t *path_fixed,
if (path->num_data) {
path->data = _cairo_malloc_ab (path->num_data,
- sizeof (cairo_path_data_t));
- if (path->data == NULL) {
+ sizeof (cairo_path_data_t));
+ if (unlikely (path->data == NULL)) {
free (path);
_cairo_error_throw (CAIRO_STATUS_NO_MEMORY);
return (cairo_path_t*) &_cairo_path_nil;