-
- SIMIX_function_register_process_create(MSG_process_create_from_SIMIX);
- SIMIX_function_register_process_cleanup(MSG_process_cleanup_from_SIMIX);
-
- simgrid::s4u::onPlatformCreated.connect(MSG_post_create_environment);
- simgrid::s4u::Host::onCreation.connect([](simgrid::s4u::Host& host) {
- MSG_host_create_(&host);
- });
- MSG_HOST_LEVEL = simgrid::s4u::Host::extension_create([](void *p) {
- __MSG_host_priv_free((msg_host_priv_t) p);
+ simgrid::s4u::Actor::on_termination.connect([](simgrid::s4u::Actor const& actor) {
+ // free the data if a function was provided
+ void* userdata = sg_actor_get_data(&actor);
+ if (userdata && msg_global->process_data_cleanup)
+ msg_global->process_data_cleanup(userdata);