- smx_host_priv_t host = (smx_host_priv_t) h;
-
- xbt_assert((host != NULL), "Invalid parameters");
-
- /* Clean Simulator data */
- if (xbt_swag_size(host->process_list) != 0) {
- char *msg = xbt_strdup("Shutting down host, but it's not empty:");
- char *tmp;
- smx_process_t process = NULL;
-
- xbt_swag_foreach(process, host->process_list) {
- tmp = bprintf("%s\n\t%s", msg, process->name);
- free(msg);
- msg = tmp;
- }
- SIMIX_display_process_status();
- THROWF(arg_error, 0, "%s", msg);
- }
- xbt_dynar_free(&host->auto_restart_processes);
- xbt_dynar_free(&host->boot_processes);
- xbt_swag_free(host->process_list);
-
- /* Clean host structure */
- free(host);
- return;
+ smx_actor_t process = SIMIX_process_self();
+ return (process == nullptr) ? nullptr : process->host;