summaryrefslogtreecommitdiff
path: root/src/cairo-pdf-operators.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-pdf-operators.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-pdf-operators.c')
-rw-r--r--src/cairo-pdf-operators.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/cairo-pdf-operators.c b/src/cairo-pdf-operators.c
index 9d5bcba11..ea5c5148d 100644
--- a/src/cairo-pdf-operators.c
+++ b/src/cairo-pdf-operators.c
@@ -301,7 +301,7 @@ _word_wrap_stream_create (cairo_output_stream_t *output, int max_column)
return _cairo_output_stream_create_in_error (output->status);
stream = malloc (sizeof (word_wrap_stream_t));
- if (stream == NULL) {
+ if (unlikely (stream == NULL)) {
_cairo_error_throw (CAIRO_STATUS_NO_MEMORY);
return (cairo_output_stream_t *) &_cairo_output_stream_nil;
}
@@ -569,7 +569,7 @@ _cairo_pdf_operators_emit_stroke_style (cairo_pdf_operators_t *pdf_operators,
*/
if (num_dashes % 2) {
dash = _cairo_malloc_abc (num_dashes, 2, sizeof (double));
- if (dash == NULL)
+ if (unlikely (dash == NULL))
return _cairo_error (CAIRO_STATUS_NO_MEMORY);
memcpy (dash, style->dash, num_dashes * sizeof (double));
@@ -585,7 +585,7 @@ _cairo_pdf_operators_emit_stroke_style (cairo_pdf_operators_t *pdf_operators,
*/
if (dash == style->dash) {
dash = _cairo_malloc_ab (num_dashes, sizeof (double));
- if (dash == NULL)
+ if (unlikely (dash == NULL))
return _cairo_error (CAIRO_STATUS_NO_MEMORY);
memcpy (dash, style->dash, num_dashes * sizeof (double));
}