#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);
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));
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);
{
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);
-}
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);
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)
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);
/**
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 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 ]###############################################################*/
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"
{
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)
-{
-
-}
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,
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;
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 */