Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
MSG_process_ref/unref: allow to fiddle with the process refcounting
[simgrid.git] / src / msg / msg_environment.cpp
index 733814c..3c3bdf8 100644 (file)
@@ -65,7 +65,11 @@ msg_netzone_t MSG_environment_as_get_by_name(const char* name)
 
 xbt_dict_t MSG_environment_as_get_routing_sons(msg_netzone_t netzone)
 {
-  return netzone->children();
+  xbt_dict_t res = xbt_dict_new_homogeneous(nullptr);
+  for (auto elem : *netzone->children()) {
+    xbt_dict_set(res, elem->name(), static_cast<void*>(elem), nullptr);
+  }
+  return res;
 }
 
 const char* MSG_environment_as_get_property_value(msg_netzone_t netzone, const char* name)
@@ -82,7 +86,7 @@ xbt_dynar_t MSG_environment_as_get_hosts(msg_netzone_t netzone)
 {
   xbt_dynar_t res = xbt_dynar_new(sizeof(sg_host_t), nullptr);
 
-  for (auto host : netzone->hosts()) {
+  for (auto host : *netzone->hosts()) {
     xbt_dynar_push(res, &host);
   }