Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
further reduce the intrusive_ptr churn
authorMartin Quinson <martin.quinson@loria.fr>
Tue, 4 Jul 2017 00:11:30 +0000 (02:11 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Tue, 4 Jul 2017 00:14:07 +0000 (02:14 +0200)
src/simix/smx_network.cpp

index 3af6159..d9ce39c 100644 (file)
@@ -193,8 +193,8 @@ SIMIX_comm_irecv(smx_actor_t dst_proc, smx_mailbox_t mbox, void* dst_buff, size_
     //if not found, assume the receiver came first, register it to the mailbox in the classical way
     if (not other_comm) {
       XBT_DEBUG("We have messages in the permanent receive list, but not the one we are looking for, pushing request into list");
     //if not found, assume the receiver came first, register it to the mailbox in the classical way
     if (not other_comm) {
       XBT_DEBUG("We have messages in the permanent receive list, but not the one we are looking for, pushing request into list");
-      other_comm = this_synchro;
-      mbox->push(this_synchro);
+      other_comm = std::move(this_synchro);
+      mbox->push(other_comm);
     } else {
       if (other_comm->surf_comm && other_comm->remains() < 1e-12) {
         XBT_DEBUG("comm %p has been already sent, and is finished, destroy it", other_comm.get());
     } else {
       if (other_comm->surf_comm && other_comm->remains() < 1e-12) {
         XBT_DEBUG("comm %p has been already sent, and is finished, destroy it", other_comm.get());
@@ -215,8 +215,8 @@ SIMIX_comm_irecv(smx_actor_t dst_proc, smx_mailbox_t mbox, void* dst_buff, size_
 
     if (other_comm == nullptr) {
       XBT_DEBUG("Receive pushed first (%zu comm enqueued so far)", mbox->comm_queue.size());
 
     if (other_comm == nullptr) {
       XBT_DEBUG("Receive pushed first (%zu comm enqueued so far)", mbox->comm_queue.size());
-      other_comm = this_synchro;
-      mbox->push(this_synchro);
+      other_comm = std::move(this_synchro);
+      mbox->push(other_comm);
     } else {
       XBT_DEBUG("Match my %p with the existing %p", this_synchro.get(), other_comm.get());
 
     } else {
       XBT_DEBUG("Match my %p with the existing %p", this_synchro.get(), other_comm.get());