/* Return value: CAIRO_STATUS_SUCCESS if successful or CAIRO_STATUS_NO_MEMORY if insufficient memory is available for the operation.  */
cairo_status_t _cairo_array_allocate(cairo_array_t *array, unsigned int num_elements, void **elements)
/* Return value: CAIRO_STATUS_SUCCESS if successful or CAIRO_STATUS_NO_MEMORY if insufficient memory is available for the operation.  */
cairo_status_t _cairo_array_allocate(cairo_array_t *array, unsigned int num_elements, void **elements)
{
    cairo_status_t status;
    status = _cairo_array_grow_by (array, num_elements);
    if (unlikely (status))
	return status;
    assert (array->num_elements + num_elements <= array->size);
    *elements = array->elements + array->num_elements * array->element_size;
    array->num_elements += num_elements;
    return CAIRO_STATUS_SUCCESS;
}