Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Use dynar to represent routes
[simgrid.git] / src / surf / network_constant.c
index 96b3485..eba71de 100644 (file)
@@ -85,7 +85,7 @@ static int resource_used(void *resource_id)
   return 0;
 }
 
-static int action_free(surf_action_t action)
+static int action_unref(surf_action_t action)
 {
   action->refcount--;
   if (!action->refcount) {
@@ -96,11 +96,6 @@ static int action_free(surf_action_t action)
   return 0;
 }
 
-static void action_use(surf_action_t action)
-{
-  action->refcount++;
-}
-
 static void action_cancel(surf_action_t action)
 {
   return;
@@ -207,16 +202,9 @@ static surf_action_t communicate(void *src, void *dst, double size,
 }
 
 /* returns an array of link_Constant_t */
-static const void **get_route(void *src, void *dst)
+static xbt_dynar_t get_route(void *src, void *dst)
 {
-  xbt_assert0(0, "Calling this function does not make any sense");
-  return (const void **) NULL;
-}
-
-static int get_route_size(void *src, void *dst)
-{
-  xbt_assert0(0, "Calling this function does not make any sense");
-  return 0;
+  xbt_die("Calling this function does not make any sense");
 }
 
 static double get_link_bandwidth(const void *link)
@@ -273,8 +261,7 @@ static void surf_network_model_init_internal(void)
   surf_network_model = surf_model_init();
 
   surf_network_model->name = "network constant";
-  surf_network_model->action_free = action_free;
-  surf_network_model->action_use = action_use;
+  surf_network_model->action_unref = action_unref;
   surf_network_model->action_cancel = action_cancel;
   surf_network_model->action_recycle = action_recycle;
 
@@ -293,7 +280,6 @@ static void surf_network_model_init_internal(void)
 
   surf_network_model->extension.network.communicate = communicate;
   surf_network_model->extension.network.get_route = get_route;
-  surf_network_model->extension.network.get_route_size = get_route_size;
   surf_network_model->extension.network.get_link_bandwidth =
     get_link_bandwidth;
   surf_network_model->extension.network.get_link_latency = get_link_latency;