From 4f5b698eee051c8a748b125502eb05d9d4dc4642 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Sat, 17 Jun 2017 19:08:56 -0600 Subject: [PATCH] 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. --- include/deal.II/dofs/dof_handler.h | 5 ----- source/dofs/dof_handler.cc | 4 ---- 2 files changed, 9 deletions(-) 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; } -- 2.39.5