From: Wolfgang Bangerth Date: Sun, 18 Jun 2017 01:08:56 +0000 (-0600) Subject: Do not check that 'new' returned a non-NULL pointer. X-Git-Tag: v9.0.0-rc1~1487^2~11 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4f5b698eee051c8a748b125502eb05d9d4dc4642;p=dealii.git Do not check that 'new' returned a non-NULL pointer. 'new' hasn't done that since C++98 but instead throws a std::bad_alloc itself. Consequently, the assertion would never have failed. --- diff --git a/include/deal.II/dofs/dof_handler.h b/include/deal.II/dofs/dof_handler.h index af38d34293..ffbc214337 100644 --- a/include/deal.II/dofs/dof_handler.h +++ b/include/deal.II/dofs/dof_handler.h @@ -1003,11 +1003,6 @@ private: const unsigned int dof_number, const types::global_dof_index index); - /** - * Exception. - */ - DeclException0 (ExcNoMemory); - private: /** * Coarsest level for which this object stores DoF indices. diff --git a/source/dofs/dof_handler.cc b/source/dofs/dof_handler.cc index 82d88ff42f..6ec3099f4f 100644 --- a/source/dofs/dof_handler.cc +++ b/source/dofs/dof_handler.cc @@ -1540,14 +1540,10 @@ void DoFHandler::MGVertexDoFs::init (const unsigned int cl, const const unsigned int n_indices = n_levels * dofs_per_vertex; indices = new types::global_dof_index[n_indices]; - Assert (indices != nullptr, ExcNoMemory ()); - for (unsigned int i = 0; i < n_indices; ++i) indices[i] = DoFHandler::invalid_dof_index; indices_offset = new types::global_dof_index[n_levels]; - Assert (indices != nullptr, ExcNoMemory ()); - for (unsigned int i = 0; i < n_levels; ++i) indices_offset[i] = i * dofs_per_vertex; }