Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
MailboxPtr looks like a smart pointer, but it's not. Kill it.
[simgrid.git] / src / s4u / s4u_Mailbox.cpp
index 604cb6a..1661442 100644 (file)
@@ -25,13 +25,13 @@ const char* Mailbox::get_cname() const
   return pimpl_->get_cname();
 }
 
-MailboxPtr Mailbox::by_name(const std::string& name)
+Mailbox* Mailbox::by_name(const std::string& name)
 {
   kernel::activity::MailboxImpl* mbox = kernel::activity::MailboxImpl::by_name_or_null(name);
   if (mbox == nullptr) {
     mbox = simix::simcall([&name] { return kernel::activity::MailboxImpl::by_name_or_create(name); });
   }
-  return MailboxPtr(&mbox->piface_, true);
+  return &mbox->piface_;
 }
 
 bool Mailbox::empty()