From: Daniel Arndt Date: Sun, 16 Oct 2016 16:08:55 +0000 (+0200) Subject: ensure allocation of an even number of elements X-Git-Tag: v8.5.0-rc1~561^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F3256%2Fhead;p=dealii.git ensure allocation of an even number of elements --- diff --git a/include/deal.II/lac/vector_operations_internal.h b/include/deal.II/lac/vector_operations_internal.h index 593256c0eb..54167ff4d6 100644 --- a/include/deal.II/lac/vector_operations_internal.h +++ b/include/deal.II/lac/vector_operations_internal.h @@ -1146,7 +1146,9 @@ namespace internal if (n_chunks > threshold_array_allocate) { - large_array.resize(n_chunks); + // make sure we allocate an even number of elements, + // access to the new last element is needed in do_sum() + large_array.resize(2*((n_chunks+1)/2)); array_ptr = &large_array[0]; } else