bug #887: use ei_declare_aligned_stack_constructed_variable instead of manual new[]/delete[] pairs in AMD and Paralellizer
diff --git a/Eigen/src/Core/products/Parallelizer.h b/Eigen/src/Core/products/Parallelizer.h index 4079063..126cfbb 100644 --- a/Eigen/src/Core/products/Parallelizer.h +++ b/Eigen/src/Core/products/Parallelizer.h
@@ -129,7 +129,7 @@ Index blockRows = (rows / threads); blockRows = (blockRows/Functor::Traits::mr)*Functor::Traits::mr; - GemmParallelInfo<Index>* info = new GemmParallelInfo<Index>[threads]; + ei_declare_aligned_stack_constructed_variable(GemmParallelInfo<Index>,info,threads,0); #pragma omp parallel num_threads(threads) { @@ -146,8 +146,6 @@ if(transpose) func(c0, actualBlockCols, 0, rows, info); else func(0, rows, c0, actualBlockCols, info); } - - delete[] info; #endif }
diff --git a/Eigen/src/OrderingMethods/Amd.h b/Eigen/src/OrderingMethods/Amd.h index 41b4fd7..ce7c0bb 100644 --- a/Eigen/src/OrderingMethods/Amd.h +++ b/Eigen/src/OrderingMethods/Amd.h
@@ -106,7 +106,8 @@ t = cnz + cnz/5 + 2*n; /* add elbow room to C */ C.resizeNonZeros(t); - Index* W = new Index[8*(n+1)]; /* get workspace */ + // get workspace + ei_declare_aligned_stack_constructed_variable(Index,W,8*(n+1),0); Index* len = W; Index* nv = W + (n+1); Index* next = W + 2*(n+1); @@ -424,8 +425,6 @@ } perm.indices().conservativeResize(n); - - delete[] W; } } // namespace internal