From: Martin Quinson Date: Tue, 4 Jul 2017 00:11:30 +0000 (+0200) Subject: further reduce the intrusive_ptr churn X-Git-Tag: v3_17~484 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/1fb2f54c35266af4042c56102ec1ad27e2cab321?ds=sidebyside further reduce the intrusive_ptr churn --- diff --git a/src/simix/smx_network.cpp b/src/simix/smx_network.cpp index 3af6159824..d9ce39c07b 100644 --- a/src/simix/smx_network.cpp +++ b/src/simix/smx_network.cpp @@ -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"); - 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()); @@ -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()); - 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());