From: Frederic Suter Date: Wed, 10 May 2017 10:58:04 +0000 (+0200) Subject: kill useless code X-Git-Tag: v3.16~274^2~41^2~5 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/358b3ac1d1ce9e2cfcc7583271916ebd96eff6da?hp=79b6186408f149d641b253ef0db88bd258c4eb3a kill useless code --- diff --git a/include/surf/surf_routing.h b/include/surf/surf_routing.h index 9b52f4ed8e..83fa79e6a6 100644 --- a/include/surf/surf_routing.h +++ b/include/surf/surf_routing.h @@ -13,8 +13,6 @@ SG_BEGIN_DECL() // FIXME: this header file should die -XBT_PUBLIC_DATA(int) SIMIX_STORAGE_LEVEL; //Simix storage level - XBT_PUBLIC_DATA(xbt_lib_t) storage_lib; XBT_PUBLIC_DATA(int) ROUTING_STORAGE_LEVEL; //Routing storage level XBT_PUBLIC_DATA(int) SURF_STORAGE_LEVEL; // Surf storage level diff --git a/src/msg/msg_environment.cpp b/src/msg/msg_environment.cpp index 295752836b..fc067f7130 100644 --- a/src/msg/msg_environment.cpp +++ b/src/msg/msg_environment.cpp @@ -43,8 +43,7 @@ void MSG_post_create_environment() { /* Initialize MSG storages */ xbt_lib_foreach(storage_lib, cursor, name, data) { - if(data[SIMIX_STORAGE_LEVEL]) - __MSG_storage_create(xbt_dict_cursor_get_elm(cursor)); + __MSG_storage_create(xbt_dict_cursor_get_elm(cursor)); } } diff --git a/src/simix/smx_global.cpp b/src/simix/smx_global.cpp index 4c7bc5391c..9292bf6ed0 100644 --- a/src/simix/smx_global.cpp +++ b/src/simix/smx_global.cpp @@ -238,11 +238,7 @@ void SIMIX_global_init(int *argc, char **argv) // TODO, create sg_storage_by_name sg_storage_t s = xbt_lib_get_elm_or_null(storage_lib, name); xbt_assert(s != nullptr, "Storage not found for name %s", name); - - SIMIX_storage_create(name, s, nullptr); }); - - SIMIX_STORAGE_LEVEL = xbt_lib_add_level(storage_lib, SIMIX_storage_destroy); } if (!simix_timers) simix_timers = xbt_heap_new(8, [](void* p) { diff --git a/src/simix/smx_io.cpp b/src/simix/smx_io.cpp index 88892bf402..759226131b 100644 --- a/src/simix/smx_io.cpp +++ b/src/simix/smx_io.cpp @@ -19,40 +19,6 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_io, simix, "Logging specific to SIMIX (io)"); -/** - * \brief Internal function to create a SIMIX storage. - * \param name name of the storage to create - * \param storage the SURF storage to encapsulate - * \param data some user data (may be nullptr) - */ -smx_storage_t SIMIX_storage_create(const char *name, void *storage, void *data) -{ - smx_storage_priv_t smx_storage = xbt_new0(s_smx_storage_priv_t, 1); - - smx_storage->data = data; - - /* Update global variables */ - xbt_lib_set(storage_lib,name,SIMIX_STORAGE_LEVEL,smx_storage); - return xbt_lib_get_elm_or_null(storage_lib, name); -} - -/** - * \brief Internal function to destroy a SIMIX storage. - * - * \param s the host to destroy (a smx_storage_t) - */ -void SIMIX_storage_destroy(void *s) -{ - smx_storage_priv_t storage = static_cast(s); - - xbt_assert((storage != nullptr), "Invalid parameters"); - if (storage->data) - free(storage->data); - - /* Clean storage structure */ - free(storage); -} - //SIMIX FILE READ void simcall_HANDLER_file_read(smx_simcall_t simcall, smx_file_t fd, sg_size_t size, sg_host_t host) { diff --git a/src/simix/smx_io_private.h b/src/simix/smx_io_private.h index 114f9c01c6..0f9bfd328a 100644 --- a/src/simix/smx_io_private.h +++ b/src/simix/smx_io_private.h @@ -11,18 +11,6 @@ #include "simgrid/simix.h" #include "popping_private.h" -/** @brief Storage datatype */ -typedef struct s_smx_storage_priv { - void *data; /**< @brief user data */ -} s_smx_storage_priv_t; - - -static inline smx_storage_priv_t SIMIX_storage_priv(smx_storage_t storage){ - return (smx_storage_priv_t) xbt_lib_get_level(storage, SIMIX_STORAGE_LEVEL); -} - -XBT_PRIVATE smx_storage_t SIMIX_storage_create(const char *name, void *storage, void *data); -XBT_PRIVATE void SIMIX_storage_destroy(void *s); XBT_PRIVATE smx_activity_t SIMIX_file_read(smx_file_t fd, sg_size_t size, sg_host_t host); XBT_PRIVATE smx_activity_t SIMIX_file_write(smx_file_t fd, sg_size_t size, sg_host_t host); XBT_PRIVATE smx_activity_t SIMIX_file_open(const char* fullpath, sg_host_t host); diff --git a/src/surf/storage_interface.cpp b/src/surf/storage_interface.cpp index a2ef0ebc59..30b7444be1 100644 --- a/src/surf/storage_interface.cpp +++ b/src/surf/storage_interface.cpp @@ -15,7 +15,6 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_storage, surf, "Logging specific to the SURF storage module"); xbt_lib_t storage_lib; -int SIMIX_STORAGE_LEVEL = -1; // Simix storage level int MSG_STORAGE_LEVEL = -1; // Msg storage level int ROUTING_STORAGE_LEVEL = -1; // Routing for storage level int SURF_STORAGE_LEVEL = -1;