Remove unsed structs from nblist and use vector in t_nblist
[alexxy/gromacs.git] / src / gromacs / nbnxm / pairsearch.cpp
index d606779b8c192833d6b5ce08e42e3e42599cdc83..546b95ff65baf7283103f925d228774d596d1380 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2019,2020, by the GROMACS development team, led by
+ * Copyright (c) 2019,2020,2021, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -46,7 +46,6 @@
 #include "pairsearch.h"
 
 #include "gromacs/mdtypes/nblist.h"
-#include "gromacs/utility/smalloc.h"
 
 #include "pairlist.h"
 
@@ -75,30 +74,19 @@ void SearchCycleCounting::printCycles(FILE* fp, gmx::ArrayRef<const PairsearchWo
     fprintf(fp, "\n");
 }
 
-/*! \brief Frees the contents of a legacy t_nblist struct */
-static void free_nblist(t_nblist* nl)
-{
-    sfree(nl->iinr);
-    sfree(nl->gid);
-    sfree(nl->shift);
-    sfree(nl->jindex);
-    sfree(nl->jjnr);
-    sfree(nl->excl_fep);
-}
-
 #ifndef DOXYGEN
 
-PairsearchWork::PairsearchWork() : cp0({ { 0 } }), ndistc(0), nbl_fep(new t_nblist), cp1({ { 0 } })
+PairsearchWork::PairsearchWork() :
+    cp0({ { 0 } }),
+    ndistc(0),
+    nbl_fep(std::make_unique<t_nblist>()),
+    cp1({ { 0 } })
 {
-    nbnxn_init_pairlist_fep(nbl_fep.get());
 }
 
 #endif // !DOXYGEN
 
-PairsearchWork::~PairsearchWork()
-{
-    free_nblist(nbl_fep.get());
-}
+PairsearchWork::~PairsearchWork() = default;
 
 PairSearch::PairSearch(const PbcType             pbcType,
                        const bool                doTestParticleInsertion,