Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Remove useless internal functions.
authorArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Mon, 28 Nov 2011 12:21:41 +0000 (13:21 +0100)
committerArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Mon, 28 Nov 2011 13:32:05 +0000 (14:32 +0100)
src/gras/Msg/msg_private.h
src/gras/Msg/rpc.c
src/simdag/private.h
src/simdag/sd_link.c
src/surf/maxmin.c
src/surf/surf_action.c
src/xbt/dict.c
src/xbt/dict_elm.c
src/xbt/dict_private.h
src/xbt/fifo.c

index b760e08..a124213 100644 (file)
@@ -130,7 +130,7 @@ gras_msg_cb_ctx_t gras_msg_cb_ctx_new(gras_socket_t expe,
 #include "xbt/mallocator.h"
 extern xbt_mallocator_t gras_msg_ctx_mallocator;
 void *gras_msg_ctx_mallocator_new_f(void);
 #include "xbt/mallocator.h"
 extern xbt_mallocator_t gras_msg_ctx_mallocator;
 void *gras_msg_ctx_mallocator_new_f(void);
-void gras_msg_ctx_mallocator_free_f(void *dict);
+#define gras_msg_ctx_mallocator_free_f xbt_free_f
 void gras_msg_ctx_mallocator_reset_f(void *dict);
 
 
 void gras_msg_ctx_mallocator_reset_f(void *dict);
 
 
index 8c7e72c..c84c605 100644 (file)
@@ -104,11 +104,6 @@ void *gras_msg_ctx_mallocator_new_f(void)
   return xbt_new0(s_gras_msg_cb_ctx_t, 1);
 }
 
   return xbt_new0(s_gras_msg_cb_ctx_t, 1);
 }
 
-void gras_msg_ctx_mallocator_free_f(void *ctx)
-{
-  xbt_free(ctx);
-}
-
 void gras_msg_ctx_mallocator_reset_f(void *ctx)
 {
   memset(ctx, 0, sizeof(s_gras_msg_cb_ctx_t));
 void gras_msg_ctx_mallocator_reset_f(void *ctx)
 {
   memset(ctx, 0, sizeof(s_gras_msg_cb_ctx_t));
index 7b55cfa..61ba759 100644 (file)
@@ -117,7 +117,7 @@ XBT_PUBLIC(xbt_swag_t) SD_simulate_swag(double how_long); /* could be public, bu
 
 
 SD_link_t __SD_link_create(void *surf_link, void *data);
 
 
 SD_link_t __SD_link_create(void *surf_link, void *data);
-void __SD_link_destroy(void *link);
+#define __SD_link_destroy xbt_free_f
 
 SD_workstation_t __SD_workstation_create(void *surf_workstation,
                                          void *data);
 
 SD_workstation_t __SD_workstation_create(void *surf_workstation,
                                          void *data);
index 2cf0faa..b9b83bb 100644 (file)
@@ -146,12 +146,3 @@ e_SD_link_sharing_policy_t SD_link_get_sharing_policy(SD_link_t link)
 {
   return link->sharing_policy;
 }
 {
   return link->sharing_policy;
 }
-
-
-/* Destroys a link.
- */
-void __SD_link_destroy(void *link)
-{
-  /* link->surf_link is freed by surf_exit and link->data is freed by the user */
-  xbt_free(link);
-}
index dc331ad..b75e448 100644 (file)
@@ -19,7 +19,7 @@ double sg_maxmin_precision = 0.00001;
 
 static void *lmm_variable_mallocator_new_f(void);
 static void lmm_variable_mallocator_free_f(void *var);
 
 static void *lmm_variable_mallocator_new_f(void);
 static void lmm_variable_mallocator_free_f(void *var);
-static void lmm_variable_mallocator_reset_f(void *var);
+#define lmm_variable_mallocator_reset_f ((void_f_pvoid_t)NULL)
 static void lmm_update_modified_set(lmm_system_t sys,
                                     lmm_constraint_t cnst);
 static void lmm_remove_all_modified_set(lmm_system_t sys);
 static void lmm_update_modified_set(lmm_system_t sys,
                                     lmm_constraint_t cnst);
 static void lmm_remove_all_modified_set(lmm_system_t sys);
@@ -173,11 +173,6 @@ static void lmm_variable_mallocator_free_f(void *var)
   xbt_free(var);
 }
 
   xbt_free(var);
 }
 
-static void lmm_variable_mallocator_reset_f(void *var)
-{
-  /* lmm_variable_new() initializes everything */
-}
-
 lmm_variable_t lmm_variable_new(lmm_system_t sys, void *id,
                                 double weight,
                                 double bound, int number_of_constraints)
 lmm_variable_t lmm_variable_new(lmm_system_t sys, void *id,
                                 double weight,
                                 double bound, int number_of_constraints)
index ea4317b..49a22ff 100644 (file)
@@ -27,7 +27,7 @@ const char *surf_action_state_names[6] = {
 static xbt_mallocator_t action_mallocator = NULL;
 static int action_mallocator_allocated_size = 0;
 static void* surf_action_mallocator_new_f(void);
 static xbt_mallocator_t action_mallocator = NULL;
 static int action_mallocator_allocated_size = 0;
 static void* surf_action_mallocator_new_f(void);
-static void surf_action_mallocator_free_f(void* action);
+#define surf_action_mallocator_free_f xbt_free_f
 static void surf_action_mallocator_reset_f(void* action);
 
 /**
 static void surf_action_mallocator_reset_f(void* action);
 
 /**
@@ -55,10 +55,6 @@ static void* surf_action_mallocator_new_f(void) {
   return xbt_malloc(action_mallocator_allocated_size);
 }
 
   return xbt_malloc(action_mallocator_allocated_size);
 }
 
-static void surf_action_mallocator_free_f(void* action) {
-  xbt_free(action);
-}
-
 static void surf_action_mallocator_reset_f(void* action) {
   memset(action, 0, action_mallocator_allocated_size);
 }
 static void surf_action_mallocator_reset_f(void* action) {
   memset(action, 0, action_mallocator_allocated_size);
 }
index c054fb5..b0a5031 100644 (file)
@@ -23,8 +23,8 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_dict, xbt,
 
 static xbt_mallocator_t dict_mallocator = NULL;
 static void *dict_mallocator_new_f(void);
 
 static xbt_mallocator_t dict_mallocator = NULL;
 static void *dict_mallocator_new_f(void);
-static void dict_mallocator_free_f(void *dict);
-static void dict_mallocator_reset_f(void *dict);
+#define dict_mallocator_free_f xbt_free_f
+#define dict_mallocator_reset_f ((void_f_pvoid_t)NULL)
 
 
 /*####[ Code ]###############################################################*/
 
 
 /*####[ Code ]###############################################################*/
@@ -816,18 +816,6 @@ static void *dict_mallocator_new_f(void)
   return xbt_new(s_xbt_dict_t, 1);
 }
 
   return xbt_new(s_xbt_dict_t, 1);
 }
 
-static void dict_mallocator_free_f(void *dict)
-{
-  xbt_free(dict);
-}
-
-static void dict_mallocator_reset_f(void *dict)
-{
-  /* nothing to do because all fields are
-   * initialized in xbt_dict_new
-   */
-}
-
 #ifdef SIMGRID_TEST
 #include "xbt.h"
 #include "xbt/ex.h"
 #ifdef SIMGRID_TEST
 #include "xbt.h"
 #include "xbt/ex.h"
index 4129989..0591621 100644 (file)
@@ -81,13 +81,3 @@ void *dict_elm_mallocator_new_f(void)
 {
   return xbt_new(s_xbt_dictelm_t, 1);
 }
 {
   return xbt_new(s_xbt_dictelm_t, 1);
 }
-
-void dict_elm_mallocator_free_f(void *elem)
-{
-  xbt_free(elem);
-}
-
-void dict_elm_mallocator_reset_f(void *elem)
-{
-
-}
index c1b6402..7bf4514 100644 (file)
@@ -44,8 +44,8 @@ typedef struct xbt_dict_cursor_ s_xbt_dict_cursor_t;
 
 extern xbt_mallocator_t dict_elm_mallocator;
 extern void *dict_elm_mallocator_new_f(void);
 
 extern xbt_mallocator_t dict_elm_mallocator;
 extern void *dict_elm_mallocator_new_f(void);
-extern void dict_elm_mallocator_free_f(void *elem);
-extern void dict_elm_mallocator_reset_f(void *elem);
+#define dict_elm_mallocator_free_f xbt_free_f
+#define dict_elm_mallocator_reset_f ((void_f_pvoid_t)NULL)
 
 /*####[ Function prototypes ]################################################*/
 xbt_dictelm_t xbt_dictelm_new(const char *key, int key_len,
 
 /*####[ Function prototypes ]################################################*/
 xbt_dictelm_t xbt_dictelm_new(const char *key, int key_len,
index 89ab25f..57e0912 100644 (file)
@@ -13,7 +13,7 @@
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_fifo, xbt, "FIFO");
 
 static void *fifo_item_mallocator_new_f(void);
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_fifo, xbt, "FIFO");
 
 static void *fifo_item_mallocator_new_f(void);
-static void fifo_item_mallocator_free_f(void *item);
+#define fifo_item_mallocator_free_f xbt_free_f
 static void fifo_item_mallocator_reset_f(void *item);
 
 static xbt_mallocator_t item_mallocator = NULL;
 static void fifo_item_mallocator_reset_f(void *item);
 
 static xbt_mallocator_t item_mallocator = NULL;
@@ -375,11 +375,6 @@ static void *fifo_item_mallocator_new_f(void)
   return xbt_new(s_xbt_fifo_item_t, 1);
 }
 
   return xbt_new(s_xbt_fifo_item_t, 1);
 }
 
-static void fifo_item_mallocator_free_f(void *item)
-{
-  xbt_free(item);
-}
-
 static void fifo_item_mallocator_reset_f(void *item)
 {
   /* memset to zero like calloc */
 static void fifo_item_mallocator_reset_f(void *item)
 {
   /* memset to zero like calloc */