X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/4ca85dfa6522596c3bf8c3d79f9c98629e06d4f4..27032003460976597e8a3fc709c0aae9fbc653a5:/src/kernel/resource/profile/Profile.cpp diff --git a/src/kernel/resource/profile/Profile.cpp b/src/kernel/resource/profile/Profile.cpp index 73f2962e88..288d618482 100644 --- a/src/kernel/resource/profile/Profile.cpp +++ b/src/kernel/resource/profile/Profile.cpp @@ -3,14 +3,17 @@ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ -#include "xbt/log.h" -#include "xbt/sysdep.h" -#include #include "src/kernel/resource/profile/Profile.hpp" -#include -#include "src/kernel/resource/profile/FutureEvtSet.cpp" -#include "src/kernel/resource/profile/DatedValue.cpp" #include "simgrid/forward.h" +#include "src/kernel/resource/profile/DatedValue.hpp" +#include "src/kernel/resource/profile/Event.hpp" +#include "src/kernel/resource/profile/FutureEvtSet.hpp" +#include "src/surf/surf_interface.hpp" + +#include +#include +#include +#include #include static std::unordered_map trace_list; @@ -25,7 +28,7 @@ Profile::Profile() DatedValue val(0, -1); event_list.push_back(val); } -Profile::~Profile() = default; +Profile::~Profile() = default; /** @brief Register this profile for that resource onto that FES, * and get an iterator over the integrated trace */ @@ -122,7 +125,22 @@ Profile* Profile::from_file(const std::string& path) return Profile::from_string(path, buffer.str(), -1); } - + } // namespace profile } // namespace kernel } // namespace simgrid + +void tmgr_finalize() +{ + for (auto const& kv : trace_list) + delete kv.second; + trace_list.clear(); +} + +void tmgr_trace_event_unref(simgrid::kernel::profile::Event** event) +{ + if ((*event)->free_me) { + delete *event; + *event = nullptr; + } +}