-/**
- * @brief Moves a process to the list of processes to destroy.
- */
-void SIMIX_process_cleanup(smx_actor_t process)
-{
- XBT_DEBUG("Cleanup process %s (%p), waiting synchro %p", process->get_cname(), process,
- process->waiting_synchro.get());
-
- simix_global->mutex.lock();
-
- simix_global->process_list.erase(process->pid_);
- if (process->host_ && process->host_process_list_hook.is_linked())
- simgrid::xbt::intrusive_erase(process->host_->pimpl_->process_list_, *process);
- if (not process->smx_destroy_list_hook.is_linked()) {
-#if SIMGRID_HAVE_MC
- xbt_dynar_push_as(simix_global->dead_actors_vector, smx_actor_t, process);
-#endif
- simix_global->process_to_destroy.push_back(*process);
- }
- process->context_->iwannadie = false;
-
- simix_global->mutex.unlock();
-}
-
-/**
- * Garbage collection
- *
- * Should be called some time to time to free the memory allocated for processes that have finished (or killed).
- */
-void SIMIX_process_empty_trash()
-{
- while (not simix_global->process_to_destroy.empty()) {
- smx_actor_t process = &simix_global->process_to_destroy.front();
- simix_global->process_to_destroy.pop_front();
- XBT_DEBUG("Getting rid of %p",process);
- intrusive_ptr_release(process);
- }
-#if SIMGRID_HAVE_MC
- xbt_dynar_reset(simix_global->dead_actors_vector);
-#endif
-}
-