Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
do not allocate/free properties
[simgrid.git] / src / kernel / actor / ActorImpl.hpp
index b820560..6289efd 100644 (file)
@@ -121,10 +121,10 @@ public:
   ActorImpl* start(const ActorCode& code);
 
   static ActorImplPtr create(const std::string& name, const ActorCode& code, void* data, s4u::Host* host,
-                             const std::unordered_map<std::string, std::string>* properties,
+                             const std::unordered_map<std::string, std::string>& properties,
                              const ActorImpl* parent_actor);
   static ActorImplPtr attach(const std::string& name, void* data, s4u::Host* host,
-                             const std::unordered_map<std::string, std::string>* properties);
+                             const std::unordered_map<std::string, std::string>& properties);
   static void detach();
   void cleanup();
   void exit();
@@ -156,7 +156,7 @@ public:
   void* data                                                               = nullptr;
   s4u::Host* host                                                          = nullptr;
   double kill_time                                                         = 0.0;
-  std::shared_ptr<const std::unordered_map<std::string, std::string>> properties = nullptr;
+  const std::unordered_map<std::string, std::string> properties;
   bool auto_restart                                                        = false;
   bool daemon_                                                             = false;
   /* list of functions executed when the process dies */
@@ -165,7 +165,7 @@ public:
   ProcessArg()                                                             = default;
 
   explicit ProcessArg(const std::string& name, const std::function<void()>& code, void* data, s4u::Host* host,
-                      double kill_time, std::shared_ptr<std::unordered_map<std::string, std::string>> properties,
+                      double kill_time, const std::unordered_map<std::string, std::string>& properties,
                       bool auto_restart)
       : name(name)
       , code(code)
@@ -187,7 +187,6 @@ public:
       , daemon_(actor->is_daemon())
       , on_exit(actor->on_exit)
   {
-    properties.reset(actor->get_properties(), [](decltype(actor->get_properties())) {});
   }
 };