Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add networkCommunicateCallback, NetworkLink::updateLatency and NetworkLink::updateBan...
[simgrid.git] / src / surf / surf_interface.cpp
index 0c117ab..56454da 100644 (file)
@@ -260,7 +260,7 @@ static const char *disk_drives_letter_table[MAX_DRIVE] = {
   "Y:\\",
   "Z:\\"
 };
-#endif  
+#endif
 
 /*
  * Returns the initial path. On Windows the initial path is
@@ -334,7 +334,9 @@ int find_model_description(s_surf_model_description_t * table,
     if (!strcmp(name, table[i].name)) {
       return i;
     }
-  name_list = strdup(table[0].name);
+  if (!table[0].name)
+    xbt_die("No model is valid! This is a bug.");
+  name_list = xbt_strdup(table[0].name);
   for (i = 1; table[i].name; i++) {
     name_list = (char *) xbt_realloc(name_list, strlen(name_list) + strlen(table[i].name) + 3);
     strcat(name_list, ", ");
@@ -870,8 +872,8 @@ void Action::setBound(double bound)
   if (p_variable)
     lmm_update_variable_bound(getModel()->getMaxminSystem(), getVariable(), bound);
 
-  if (getModel()->getUpdateMechanism() == UM_LAZY)
-       heapRemove(getModel()->getActionHeap());
+  if (getModel()->getUpdateMechanism() == UM_LAZY && getLastUpdate()!=surf_get_clock())
+         heapRemove(getModel()->getActionHeap());
   XBT_OUT();
 }