Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
2 other memleaks got jammed
authorMartin Quinson <martin.quinson@loria.fr>
Mon, 29 May 2017 20:04:09 +0000 (22:04 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Mon, 29 May 2017 20:24:31 +0000 (22:24 +0200)
src/simix/smx_network.cpp

index 5ea2ced..410eb3b 100644 (file)
@@ -117,7 +117,7 @@ XBT_PRIVATE smx_activity_t simcall_HANDLER_comm_isend(smx_simcall_t simcall, smx
       other_comm->dst_proc=mbox->permanent_receiver.get();
       other_comm          = static_cast<simgrid::kernel::activity::CommImpl*>(SIMIX_comm_ref(other_comm));
       mbox->done_comm_queue.push_back(other_comm);
       other_comm->dst_proc=mbox->permanent_receiver.get();
       other_comm          = static_cast<simgrid::kernel::activity::CommImpl*>(SIMIX_comm_ref(other_comm));
       mbox->done_comm_queue.push_back(other_comm);
-      XBT_DEBUG("pushing a message into the permanent receive list %p, comm %p", mbox, &(other_comm));
+      XBT_DEBUG("pushing a message into the permanent receive list %p, comm %p", mbox, other_comm);
 
     }else{
       mbox->push(this_comm);
 
     }else{
       mbox->push(this_comm);
@@ -193,6 +193,7 @@ smx_activity_t SIMIX_comm_irecv(smx_actor_t dst_proc, smx_mailbox_t mbox, void *
   //communication already done, get it inside the list of completed comms
   if (mbox->permanent_receiver != nullptr && not mbox->done_comm_queue.empty()) {
 
   //communication already done, get it inside the list of completed comms
   if (mbox->permanent_receiver != nullptr && not mbox->done_comm_queue.empty()) {
 
+    SIMIX_comm_unref(this_synchro);
     XBT_DEBUG("We have a comm that has probably already been received, trying to match it, to skip the communication");
     //find a match in the list of already received comms
     other_comm = _find_matching_comm(&mbox->done_comm_queue, SIMIX_COMM_SEND, match_fun, data, this_synchro,
     XBT_DEBUG("We have a comm that has probably already been received, trying to match it, to skip the communication");
     //find a match in the list of already received comms
     other_comm = _find_matching_comm(&mbox->done_comm_queue, SIMIX_COMM_SEND, match_fun, data, this_synchro,
@@ -208,6 +209,7 @@ smx_activity_t SIMIX_comm_irecv(smx_actor_t dst_proc, smx_mailbox_t mbox, void *
         other_comm->state = SIMIX_DONE;
         other_comm->type = SIMIX_COMM_DONE;
         other_comm->mbox = nullptr;
         other_comm->state = SIMIX_DONE;
         other_comm->type = SIMIX_COMM_DONE;
         other_comm->mbox = nullptr;
+        SIMIX_comm_unref(other_comm);
       }
       SIMIX_comm_unref(other_comm);
       SIMIX_comm_unref(this_synchro);
       }
       SIMIX_comm_unref(other_comm);
       SIMIX_comm_unref(this_synchro);