Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Chord: display the number of messages created
[simgrid.git] / src / simix / smx_network.c
index 8956b25..d5dba6a 100644 (file)
@@ -13,6 +13,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_network, simix,
                                 "Logging specific to SIMIX (network)");
 
 static xbt_dict_t rdv_points = NULL;
+unsigned long int smx_total_comms = 0;
 
 static XBT_INLINE void SIMIX_comm_start(smx_action_t action);
 static void SIMIX_comm_finish(smx_action_t action);
@@ -164,10 +165,9 @@ smx_action_t SIMIX_comm_new(e_smx_comm_type_t type)
   smx_action_t act;
 
   /* alloc structures */
-  act = xbt_new0(s_smx_action_t, 1);
+  act = xbt_mallocator_get(simix_global->action_mallocator);
   act->type = SIMIX_ACTION_COMMUNICATE;
   act->state = SIMIX_WAITING;
-  act->request_list = xbt_fifo_new();
 
   /* set communication */
   act->comm.type = type;
@@ -183,6 +183,7 @@ smx_action_t SIMIX_comm_new(e_smx_comm_type_t type)
 #endif
 
   DEBUG1("Create communicate action %p", act);
+  ++smx_total_comms;
 
   return act;
 }
@@ -212,11 +213,7 @@ void SIMIX_comm_destroy(smx_action_t action)
   TRACE_smx_action_destroy(action);
 #endif
 
-  if (action->name)
-    xbt_free(action->name);
-
-  xbt_fifo_free(action->request_list);
-
+  xbt_free(action->name);
   SIMIX_comm_destroy_internal_actions(action);
 
   if (action->comm.detached && action->state != SIMIX_DONE) {
@@ -225,7 +222,7 @@ void SIMIX_comm_destroy(smx_action_t action)
     ((void_f_pvoid_t) action->comm.src_data)(action->comm.src_buff);
   }
 
-  xbt_free(action);
+  xbt_mallocator_release(simix_global->action_mallocator, action);
 }
 
 void SIMIX_comm_destroy_internal_actions(smx_action_t action)