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-path-stroke.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-path-stroke.c')
-rw-r--r-- | src/cairo-path-stroke.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cairo-path-stroke.c b/src/cairo-path-stroke.c index f2b9e7ae1..8c3064eaf 100644 --- a/src/cairo-path-stroke.c +++ b/src/cairo-path-stroke.c @@ -1254,7 +1254,7 @@ _cairo_rectilinear_stroker_add_segment (cairo_rectilinear_stroker_t *stroker, if (stroker->segments == stroker->segments_embedded) { new_segments = _cairo_malloc_ab (new_size, sizeof (cairo_line_t)); - if (new_segments == NULL) + if (unlikely (new_segments == NULL)) return _cairo_error (CAIRO_STATUS_NO_MEMORY); memcpy (new_segments, stroker->segments, @@ -1262,7 +1262,7 @@ _cairo_rectilinear_stroker_add_segment (cairo_rectilinear_stroker_t *stroker, } else { new_segments = _cairo_realloc_ab (stroker->segments, new_size, sizeof (cairo_line_t)); - if (new_segments == NULL) + if (unlikely (new_segments == NULL)) return _cairo_error (CAIRO_STATUS_NO_MEMORY); } |