From: suter Date: Fri, 30 May 2014 21:48:08 +0000 (+0200) Subject: chased tabs while looking for a leak X-Git-Tag: v3_11~3 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/99b9d1dfab1cfc49e080d24a6c5022723864b15d chased tabs while looking for a leak --- diff --git a/src/surf/storage_interface.cpp b/src/surf/storage_interface.cpp index 28de019eb4..a068ac62e1 100644 --- a/src/surf/storage_interface.cpp +++ b/src/surf/storage_interface.cpp @@ -50,7 +50,8 @@ StorageModel::~StorageModel(){ ************/ Storage::Storage(ModelPtr model, const char *name, xbt_dict_t props, - const char* type_id, char *content_name, char *content_type, sg_size_t size) + const char* type_id, char *content_name, char *content_type, + sg_size_t size) : Resource(model, name, props) , p_contentType(content_type) , m_size(size), m_usedSize(0) @@ -63,8 +64,9 @@ Storage::Storage(ModelPtr model, const char *name, xbt_dict_t props, } Storage::Storage(ModelPtr model, const char *name, xbt_dict_t props, - lmm_system_t maxminSystem, double bread, double bwrite, double bconnection, - const char* type_id, char *content_name, char *content_type, sg_size_t size, char *attach) + lmm_system_t maxminSystem, double bread, double bwrite, + double bconnection, const char* type_id, char *content_name, + char *content_type, sg_size_t size, char *attach) : Resource(model, name, props, lmm_constraint_new(maxminSystem, this, bconnection)) , p_contentType(content_type) , m_size(size), m_usedSize(0) diff --git a/src/surf/storage_interface.hpp b/src/surf/storage_interface.hpp index 07eaf8d2ad..c578bff16e 100644 --- a/src/surf/storage_interface.hpp +++ b/src/surf/storage_interface.hpp @@ -276,8 +276,8 @@ public: * @param storage The Storage associated to this StorageAction * @param type [description] */ - StorageAction(ModelPtr model, double cost, bool failed, - StoragePtr storage, e_surf_action_storage_type_t type); + StorageAction(ModelPtr model, double cost, bool failed, StoragePtr storage, + e_surf_action_storage_type_t type); /** * @brief StorageAction constructor @@ -290,7 +290,7 @@ public: * @param type [description] */ StorageAction(ModelPtr model, double cost, bool failed, lmm_variable_t var, - StoragePtr storage, e_surf_action_storage_type_t type); + StoragePtr storage, e_surf_action_storage_type_t type); void setState(e_surf_action_state_t state); diff --git a/src/surf/storage_n11.cpp b/src/surf/storage_n11.cpp index 046b6e82f0..6cecbca440 100644 --- a/src/surf/storage_n11.cpp +++ b/src/surf/storage_n11.cpp @@ -235,7 +235,8 @@ StorageN11Model::~StorageN11Model(){ } StoragePtr StorageN11Model::createStorage(const char* id, const char* type_id, - const char* content_name, const char* content_type, xbt_dict_t properties, const char* attach) + const char* content_name, const char* content_type, xbt_dict_t properties, + const char* attach) { xbt_assert(!surf_storage_resource_priv(surf_storage_resource_by_name(id)), @@ -249,8 +250,8 @@ StoragePtr StorageN11Model::createStorage(const char* id, const char* type_id, double Bconnection = surf_parse_get_bandwidth((char*)xbt_dict_get(storage_type->model_properties, "Bconnection")); StoragePtr storage = new StorageN11(this, id, properties, p_maxminSystem, - Bread, Bwrite, Bconnection, - type_id, (char *)content_name, xbt_strdup(content_type), storage_type->size, (char *) attach); + Bread, Bwrite, Bconnection, type_id, (char *)content_name, + xbt_strdup(content_type), storage_type->size, (char *) attach); xbt_lib_set(storage_lib, id, SURF_STORAGE_LEVEL, storage); @@ -261,7 +262,7 @@ StoragePtr StorageN11Model::createStorage(const char* id, const char* type_id, Bread); if(!p_storageList) - p_storageList = xbt_dynar_new(sizeof(char *),NULL); + p_storageList = xbt_dynar_new(sizeof(char *),NULL); xbt_dynar_push(p_storageList, &storage); return storage; @@ -370,9 +371,10 @@ void StorageN11Model::updateActionsState(double /*now*/, double delta) * Resource * ************/ -StorageN11::StorageN11(StorageModelPtr model, const char* name, xbt_dict_t properties, - lmm_system_t maxminSystem, double bread, double bwrite, double bconnection, - const char* type_id, char *content_name, char *content_type, sg_size_t size, char *attach) +StorageN11::StorageN11(StorageModelPtr model, const char* name, + xbt_dict_t properties, lmm_system_t maxminSystem, double bread, + double bwrite, double bconnection, const char* type_id, char *content_name, + char *content_type, sg_size_t size, char *attach) : Storage(model, name, properties, maxminSystem, bread, bwrite, bconnection, type_id, content_name, content_type, size, attach) { XBT_DEBUG("Create resource with Bconnection '%f' Bread '%f' Bwrite '%f' and Size '%llu'", bconnection, bread, bwrite, size); diff --git a/src/surf/surf_interface.cpp b/src/surf/surf_interface.cpp index 52b1722bd3..6a64cb31a5 100644 --- a/src/surf/surf_interface.cpp +++ b/src/surf/surf_interface.cpp @@ -93,10 +93,10 @@ xbt_dict_t watched_hosts_lib; surf_callback(void, void) surfExitCallbacks; s_surf_model_description_t surf_plugin_description[] = { - {"Energy", - "Cpu energy consumption.", - sg_energy_plugin_init}, - {NULL, NULL, NULL} /* this array must be NULL terminated */ + {"Energy", + "Cpu energy consumption.", + sg_energy_plugin_init}, + {NULL, NULL, NULL} /* this array must be NULL terminated */ }; /* Don't forget to update the option description in smx_config when you change this */ @@ -509,11 +509,11 @@ double Model::shareResources(double now) { //FIXME: set the good function once and for all if (p_updateMechanism == UM_LAZY) - return shareResourcesLazy(now); + return shareResourcesLazy(now); else if (p_updateMechanism == UM_FULL) - return shareResourcesFull(now); + return shareResourcesFull(now); else - xbt_die("Invalid cpu update mechanism!"); + xbt_die("Invalid cpu update mechanism!"); } double Model::shareResourcesLazy(double now) @@ -610,7 +610,7 @@ double Model::shareResourcesMaxMin(ActionListPtr running_actions, ActionList::iterator it(running_actions->begin()), itend(running_actions->end()); for(; it != itend ; ++it) { - action = &*it; + action = &*it; value = lmm_variable_getvalue(action->getVariable()); if ((value > 0) || (action->getMaxDuration() >= 0)) break; @@ -738,7 +738,7 @@ const char *Resource::getName() { xbt_dict_t Resource::getProperties() { if (p_properties==NULL) - p_properties = xbt_dict_new(); + p_properties = xbt_dict_new(); return p_properties; } @@ -851,7 +851,7 @@ void Action::setState(e_surf_action_state_t state) p_stateSet = NULL; if (p_stateSet) - p_stateSet->push_back(*this); + p_stateSet->push_back(*this); XBT_OUT(); } @@ -867,7 +867,7 @@ void Action::setBound(double bound) lmm_update_variable_bound(getModel()->getMaxminSystem(), getVariable(), bound); if (getModel()->getUpdateMechanism() == UM_LAZY && getLastUpdate()!=surf_get_clock()) - heapRemove(getModel()->getActionHeap()); + heapRemove(getModel()->getActionHeap()); XBT_OUT(); } @@ -925,8 +925,8 @@ void Action::setPriority(double priority) void Action::cancel(){ setState(SURF_ACTION_FAILED); if (getModel()->getUpdateMechanism() == UM_LAZY) { - if (actionLmmHook::is_linked()) - getModel()->getModifiedSet()->erase(getModel()->getModifiedSet()->iterator_to(*this)); + if (actionLmmHook::is_linked()) + getModel()->getModifiedSet()->erase(getModel()->getModifiedSet()->iterator_to(*this)); heapRemove(getModel()->getActionHeap()); } } @@ -934,18 +934,18 @@ void Action::cancel(){ int Action::unref(){ m_refcount--; if (!m_refcount) { - if (actionHook::is_linked()) - p_stateSet->erase(p_stateSet->iterator_to(*this)); - if (getVariable()) - lmm_variable_free(getModel()->getMaxminSystem(), getVariable()); - if (getModel()->getUpdateMechanism() == UM_LAZY) { - /* remove from heap */ - heapRemove(getModel()->getActionHeap()); + if (actionHook::is_linked()) + p_stateSet->erase(p_stateSet->iterator_to(*this)); + if (getVariable()) + lmm_variable_free(getModel()->getMaxminSystem(), getVariable()); + if (getModel()->getUpdateMechanism() == UM_LAZY) { + /* remove from heap */ + heapRemove(getModel()->getActionHeap()); if (actionLmmHook::is_linked()) - getModel()->getModifiedSet()->erase(getModel()->getModifiedSet()->iterator_to(*this)); + getModel()->getModifiedSet()->erase(getModel()->getModifiedSet()->iterator_to(*this)); } - delete this; - return 1; + delete this; + return 1; } return 0; } diff --git a/src/surf/workstation_interface.hpp b/src/surf/workstation_interface.hpp index add4082eca..967f2e484e 100644 --- a/src/surf/workstation_interface.hpp +++ b/src/surf/workstation_interface.hpp @@ -165,8 +165,9 @@ public: * @param netElm The RoutingEdge associated to this Workstation * @param cpu The Cpu associated to this Workstation */ - Workstation(ModelPtr model, const char *name, xbt_dict_t props, lmm_constraint_t constraint, - xbt_dynar_t storage, RoutingEdgePtr netElm, CpuPtr cpu); + Workstation(ModelPtr model, const char *name, xbt_dict_t props, + lmm_constraint_t constraint, xbt_dynar_t storage, RoutingEdgePtr netElm, + CpuPtr cpu); /** * @brief Workstation destructor