They were "still reachable", but annoying nonetheless.
/** Constructor, taking the command line parameters of your main function */
Engine(int *argc, char **argv);
+ /** Finalize the default engine and all its dependencies */
+ static void shutdown();
+
/** @brief Load a platform file describing the environment
*
* The environment is either a XML file following the simgrid.dtd formalism, or a lua file.
std::string name_;
smx_mailbox_t inferior_;
static boost::unordered_map<std::string, Mailbox *> *mailboxes;
+ friend s4u::Engine;
};
}} // namespace simgrid::s4u
protected:
smx_storage_t inferior();
private:
+ friend s4u::Engine;
+
static boost::unordered_map<std::string, Storage *> *storages_;
std::string name_;
smx_storage_t inferior_;
#include "mc/mc.h"
#include "simgrid/s4u/As.hpp"
#include "simgrid/s4u/engine.hpp"
+#include "simgrid/s4u/mailbox.hpp"
+#include "simgrid/s4u/storage.hpp"
XBT_LOG_NEW_CATEGORY(s4u,"Log channels of the S4U (Simgrid for you) interface");
using namespace simgrid;
return s4u::Engine::instance_;
}
+void s4u::Engine::shutdown() {
+ delete s4u::Engine::instance_;
+ s4u::Engine::instance_ = nullptr;
+ delete s4u::Mailbox::mailboxes;
+ delete s4u::Storage::storages_;
+}
+
double s4u::Engine::getClock()
{
return SIMIX_get_clock();
#include "mc/mc.h"
#include "virtual_machine.hpp"
#include "src/instr/instr_private.h" // TRACE_is_enabled(). FIXME: remove by subscribing tracing to the surf signals
+#include "simgrid/s4u/engine.hpp"
XBT_LOG_NEW_CATEGORY(surf, "All SURF categories");
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_kernel, surf, "Logging specific to SURF (kernel)");
tmgr_finalize();
sg_platf_exit();
+ simgrid::s4u::Engine::shutdown();
NOW = 0; /* Just in case the user plans to restart the simulation afterward */
}