X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/4b6ea22affbf2fb45a2e80779c789047121ceff6..440ced834dc98975c18cf7130ae1d6d9018438db:/src/mc/mc_object_info.cpp diff --git a/src/mc/mc_object_info.cpp b/src/mc/mc_object_info.cpp index 5222260291..7fc980821e 100644 --- a/src/mc/mc_object_info.cpp +++ b/src/mc/mc_object_info.cpp @@ -14,19 +14,6 @@ namespace simgrid { namespace mc { -// Free functions - -static void mc_variable_free_voidp(void *t) -{ - delete *(simgrid::mc::Variable**)t; -} - -static void mc_frame_free_voipd(void** p) -{ - delete *(mc_frame_t**)p; - *p = nullptr; -} - // Type Type::Type() @@ -59,21 +46,11 @@ Frame::Frame() this->tag = 0; this->low_pc = nullptr; this->high_pc = nullptr; - this->variables = xbt_dynar_new( - sizeof(mc_variable_t), mc_variable_free_voidp); this->id = 0; - this->scopes = xbt_dynar_new( - sizeof(mc_frame_t), (void_f_pvoid_t) mc_frame_free_voipd); this->abstract_origin_id = 0; this->object_info = nullptr; } -Frame::~Frame() -{ - xbt_dynar_free(&(this->variables)); - xbt_dynar_free(&(this->scopes)); -} - // ObjectInformations mc_frame_t ObjectInformation::find_function(const void *ip) const @@ -96,13 +73,11 @@ mc_frame_t ObjectInformation::find_function(const void *ip) const return nullptr; } -mc_variable_t ObjectInformation::find_variable(const char* name) const +simgrid::mc::Variable* ObjectInformation::find_variable(const char* name) const { - unsigned int cursor = 0; - mc_variable_t variable; - xbt_dynar_foreach(this->global_variables, cursor, variable) - if(variable->name == name) - return variable; + for (simgrid::mc::Variable& variable : this->global_variables) + if(variable.name == name) + return &variable; return nullptr; }