From 2ed48966b2f4f4c6ad70227f8391945fab7ceccd Mon Sep 17 00:00:00 2001
From: David Parsons <david.parsons@inria.fr>
Date: Thu, 7 Dec 2023 16:52:49 +0100
Subject: [PATCH] remove commented code

---
 src/libaevol/7/DnaFactory.cpp | 22 ----------------------
 1 file changed, 22 deletions(-)

diff --git a/src/libaevol/7/DnaFactory.cpp b/src/libaevol/7/DnaFactory.cpp
index a1bc53e50..c3345084c 100644
--- a/src/libaevol/7/DnaFactory.cpp
+++ b/src/libaevol/7/DnaFactory.cpp
@@ -44,7 +44,6 @@ namespace aevol {
 DnaFactory::DnaFactory(DnaFactory_Policy policy, int pool_size, int init_size, int pop_size) {
   policy_    = policy;
   pool_size_ = pool_size;
-  // printf("Pool init \n");
   init(init_size, pop_size);
 }
 
@@ -75,8 +74,6 @@ void DnaFactory::init(int init_size, int pop_size) {
     #pragma omp parallel reduction(+ : n)
     { n += 1; }
 
-    // printf("NB OpenMP : %d\n",n);
-
     local_list_unused_dna_.resize(n);
     if (pop_size != -1) {
       local_pool_size_  = (pop_size / n) * 4;
@@ -114,7 +111,6 @@ Dna_7 *DnaFactory::get_dna(int request_size) {
       pop = new Dna_7(request_size);
 
     return pop;
-    // return new Dna_7(request_size,this);
   } else if (policy_ == DnaFactory_Policy::FIRSTFIT) {
     Dna_7 *pop = nullptr;
 
@@ -145,16 +141,12 @@ Dna_7 *DnaFactory::get_dna(int request_size) {
     Dna_7 *pop = nullptr;
 
     if (local_list_unused_dna_[omp_get_thread_num()].empty()) {
-      // #pragma omp atomic
-      // empty_global+=1;
-
       if (list_unused_dna_.empty()) {
         pop = new Dna_7(request_size);
       } else {
         // Go to global (and lock)
         #pragma omp critical(pop_dna)
         {
-          // printf("Search global array of DNA\n");
           std::list<Dna_7 *>::iterator found_it;
           for (auto it = list_unused_dna_.begin(); it != list_unused_dna_.end(); it++) {
             if ((*it)->nb_block() >= req_block) {
@@ -176,9 +168,6 @@ Dna_7 *DnaFactory::get_dna(int request_size) {
       // Go to local (and lock free)
       std::list<Dna_7 *>::iterator found_it;
 
-      // #pragma omp atomic
-      // local_empty++;
-
       for (auto it = local_list_unused_dna_[omp_get_thread_num()].begin();
            it != local_list_unused_dna_[omp_get_thread_num()].end();
            it++) {
@@ -205,13 +194,8 @@ Dna_7 *DnaFactory::get_dna(int request_size) {
 
 void DnaFactory::give_back(Dna_7 *dna) {
   dna->reset_stat();
-  //   delete dna;
   if (policy_ == DnaFactory_Policy::LOCAL_GLOBAL_FIT) {
     if (local_list_unused_dna_[omp_get_thread_num()].size() == local_pool_size_) {
-
-      // #pragma omp atomic
-      // free_space_local++;
-
       Dna_7 *pop = local_list_unused_dna_[omp_get_thread_num()].back();
       local_list_unused_dna_[omp_get_thread_num()].pop_back();
 
@@ -219,16 +203,10 @@ void DnaFactory::give_back(Dna_7 *dna) {
       { list_unused_dna_.push_back(pop); }
     }
 
-    // #pragma omp atomic
-    // free_local++;
-
     local_list_unused_dna_[omp_get_thread_num()].push_front(dna);
   } else if (policy_ == DnaFactory_Policy::ALLOCATE) {
     delete dna;
   } else {
-    // #pragma omp atomic
-    // free_global++;
-
     #pragma omp critical(pop_dna)
     { list_unused_dna_.push_back(dna); }
   }
-- 
GitLab