third_party/cairo/src/cairo-tristrip.c
static cairo_bool_t
_cairo_tristrip_grow (cairo_tristrip_t *strip)
{
    cairo_point_t *points;
    int new_size = 4 * strip->size_points;

    if (CAIRO_INJECT_FAULT ()) {
	strip->status = _cairo_error (CAIRO_STATUS_NO_MEMORY);
	return FALSE;
    }

    if (strip->points == strip->points_embedded) {
	points = _cairo_malloc_ab (new_size, sizeof (cairo_point_t));
	if (points != NULL)
	    memcpy (points, strip->points, sizeof (strip->points_embedded));
    } else {
	points = _cairo_realloc_ab (strip->points,
	                               new_size, sizeof (cairo_trapezoid_t));
    }

    if (unlikely (points == NULL)) {
	strip->status = _cairo_error (CAIRO_STATUS_NO_MEMORY);
	return FALSE;
    }

    strip->points = points;
    strip->size_points = new_size;
    return TRUE;
}
/* make room for at least one more trap */
make room for at least one more trap
make room for at least one more trap
static cairo_bool_t
_cairo_tristrip_grow (cairo_tristrip_t *strip)
{
    cairo_point_t *points;
    int new_size = 4 * strip->size_points;
    if (CAIRO_INJECT_FAULT ()) {
	strip->status = _cairo_error (CAIRO_STATUS_NO_MEMORY);
	return FALSE;
    }
    if (strip->points == strip->points_embedded) {
	points = _cairo_malloc_ab (new_size, sizeof (cairo_point_t));
	if (points != NULL)
	    memcpy (points, strip->points, sizeof (strip->points_embedded));
    } else {
	points = _cairo_realloc_ab (strip->points,
	                               new_size, sizeof (cairo_trapezoid_t));
    }
    if (unlikely (points == NULL)) {
	strip->status = _cairo_error (CAIRO_STATUS_NO_MEMORY);
	return FALSE;
    }
    strip->points = points;
    strip->size_points = new_size;
    return TRUE;
}
static cairo_bool_t _cairo_tristrip_grow ( cairo_tristrip_t * strip ) { cairo_point_t * points ; int new_size = 4 * strip -> size_points ; if ( CAIRO_INJECT_FAULT ( ) ) { strip -> status = _cairo_error ( CAIRO_STATUS_NO_MEMORY ) ; return FALSE ; } if ( strip -> points == strip -> points_embedded ) { points = _cairo_malloc_ab ( new_size , sizeof ( cairo_point_t ) ) ; if ( points != NULL ) memcpy ( points , strip -> points , sizeof ( strip -> points_embedded ) ) ; } else { points = _cairo_realloc_ab ( strip -> points , new_size , sizeof ( cairo_trapezoid_t ) ) ; } if ( unlikely ( points == NULL ) ) { strip -> status = _cairo_error ( CAIRO_STATUS_NO_MEMORY ) ; return FALSE ; } strip -> points = points ; strip -> size_points = new_size ; return TRUE ; }
make room for at least one more trap
make room for at least one more trap