Browse Source

some more memory frees

avadapal 1 year ago
parent
commit
c44a38efeb
1 changed files with 4 additions and 3 deletions
  1. 4 3
      preprocessing/p2preprocessing.cpp

+ 4 - 3
preprocessing/p2preprocessing.cpp

@@ -139,8 +139,7 @@ int main(int argc, char* argv[])
 
 
  
- dpfP2 * dpf_instance0 = (dpfP2 * ) malloc (sizeof(dpfP2) * n_threads);
- dpfP2 * dpf_instance1 = (dpfP2 * ) malloc (sizeof(dpfP2) * n_threads);
+
  
 
     
@@ -187,6 +186,9 @@ int main(int argc, char* argv[])
   communication_cost += sizeof(computecw0_array);
   communication_cost += sizeof(computecw1_array);
  
+  dpfP2 * dpf_instance0 = (dpfP2 * ) malloc (sizeof(dpfP2) * n_threads);
+  dpfP2 * dpf_instance1 = (dpfP2 * ) malloc (sizeof(dpfP2) * n_threads);
+
   boost::asio::read(sockets0[0], boost::asio::buffer(dpf_instance0, n_threads * sizeof(dpfP2)));
   boost::asio::read(sockets1[0], boost::asio::buffer(dpf_instance1, n_threads * sizeof(dpfP2))); 
 
@@ -309,7 +311,6 @@ int main(int argc, char* argv[])
     std::chrono::duration<double> elapsed_seconds = end-start;
     //std::cout << "time to generate and evaluate " << n_threads << " dpfs of size 2^" << atoi(argv[4]) << " is: " << elapsed_seconds.count() << "s\n";
     std::cout << "WallClockTime: "  << elapsed_seconds.count() << std::endl;
-
     std::cout << "CommunicationCost: " << communication_cost << " bytes" << std::endl;
   return 0;
 }