Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
fix build (and please valgrind)
authorFrederic Suter <frederic.suter@cc.in2p3.fr>
Wed, 6 Jun 2018 12:15:47 +0000 (14:15 +0200)
committerFrederic Suter <frederic.suter@cc.in2p3.fr>
Wed, 6 Jun 2018 12:15:47 +0000 (14:15 +0200)
include/simgrid/s4u/Link.hpp
src/kernel/EngineImpl.cpp
src/s4u/s4u_Link.cpp

index d95a753..c02774c 100644 (file)
@@ -34,7 +34,6 @@ class XBT_PUBLIC Link : public simgrid::xbt::Extendable<Link> {
 public:
   enum class SharingPolicy { SPLITDUPLEX = 2, SHARED = 1, FATPIPE = 0 };
 
-  virtual void destroy();
   kernel::resource::LinkImpl* get_impl() { return pimpl_; }
 
   /** @brief Retrieve a link from its name */
index 9fa10c8..401e3a7 100644 (file)
@@ -7,8 +7,8 @@
 #include "simgrid/kernel/routing/NetPoint.hpp"
 #include "simgrid/kernel/routing/NetZoneImpl.hpp"
 #include "simgrid/s4u/Host.hpp"
-#include "simgrid/s4u/Link.hpp"
 #include "src/surf/StorageImpl.hpp"
+#include "src/surf/network_interface.hpp"
 
 #include <algorithm>
 
@@ -42,9 +42,10 @@ EngineImpl::~EngineImpl()
   for (auto const& kv : storages_)
     if (kv.second)
       kv.second->getImpl()->destroy();
+
   for (auto const& kv : links_)
     if (kv.second)
-      (kv.second)->destroy();
+      kv.second->get_impl()->destroy();
 }
 }
 }
index c084839..bf07bfd 100644 (file)
@@ -25,15 +25,6 @@ simgrid::xbt::signal<void(Link&)> Link::on_bandwidth_change;
 simgrid::xbt::signal<void(kernel::resource::NetworkAction*, Host* src, Host* dst)> Link::on_communicate;
 simgrid::xbt::signal<void(kernel::resource::NetworkAction*)> Link::on_communication_state_change;
 
-void Link::destroy()
-{
-  if (not currentlyDestroying_) {
-    currentlyDestroying_ = true;
-    on_destruction(*this);
-    Engine::get_instance()->link_unregister(std::string(pimpl_->get_cname()));
-  }
-}
-
 Link* Link::by_name(std::string name)
 {
   return Engine::get_instance()->link_by_name(name);