Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Replace xbt_heap by boost::heap::fibonacci_heap
[simgrid.git] / src / surf / cpu_interface.cpp
index 7dc2d1a..8c667e5 100644 (file)
@@ -53,9 +53,11 @@ void cpu_add_traces(){
 void CpuModel::updateActionsStateLazy(double now, double /*delta*/)
 {
   CpuActionPtr action;
-  while ((xbt_heap_size(getActionHeap()) > 0)
-         && (double_equals(xbt_heap_maxkey(getActionHeap()), now, sg_surf_precision))) {
-    action = static_cast<CpuActionPtr>(xbt_heap_pop(getActionHeap()));
+  while ((!getActionHeap()->empty())
+         && (double_equals(getActionHeap()->topKey(), now, sg_surf_precision))) {
+
+    action = static_cast<CpuActionPtr>(getActionHeap()->topValue());
+    getActionHeap()->pop();
     XBT_CDEBUG(surf_kernel, "Something happened to action %p", action);
 #ifdef HAVE_TRACING
     if (TRACE_is_enabled()) {
@@ -73,7 +75,6 @@ void CpuModel::updateActionsStateLazy(double now, double /*delta*/)
     /* set the remains to 0 due to precision problems when updating the remaining amount */
     action->setRemains(0);
     action->setState(SURF_ACTION_DONE);
-    action->heapRemove(getActionHeap()); //FIXME: strange call since action was already popped
   }
 #ifdef HAVE_TRACING
   if (TRACE_is_enabled()) {