From: Martin Quinson Date: Fri, 6 May 2016 20:40:21 +0000 (+0200) Subject: inline a bunch of useless functions X-Git-Tag: v3_14~1264 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/972162bac11e3df7266030562100d2f8e43870b2 inline a bunch of useless functions --- diff --git a/src/simix/smx_global.cpp b/src/simix/smx_global.cpp index d693ac8812..9b31320d6a 100644 --- a/src/simix/smx_global.cpp +++ b/src/simix/smx_global.cpp @@ -293,7 +293,7 @@ void SIMIX_clean(void) simix_global->mutex = NULL; /* Let's free maestro now */ - SIMIX_context_free(simix_global->maestro_process->context); + delete simix_global->maestro_process->context; xbt_free(simix_global->maestro_process->running_ctx); xbt_free(simix_global->maestro_process); simix_global->maestro_process = NULL; diff --git a/src/simix/smx_private.hpp b/src/simix/smx_private.hpp index 591265e2bb..abea06bf70 100644 --- a/src/simix/smx_private.hpp +++ b/src/simix/smx_private.hpp @@ -11,47 +11,14 @@ #include "smx_private.h" #include "src/simix/popping_private.h" -/** - * \brief destroy a context - * \param context the context to destroy - * Argument must be stopped first -- runs in maestro context - */ -static inline void SIMIX_context_free(smx_context_t context) -{ - delete context; -} - -/** - * \brief stops the execution of a context - * \param context to stop - */ -static inline void SIMIX_context_stop(smx_context_t context) -{ - context->stop(); -} - -/** - \brief suspends a context and return the control back to the one which - scheduled it - \param context the context to be suspended (it must be the running one) - */ -static inline void SIMIX_context_suspend(smx_context_t context) -{ - context->suspend(); -} - -/** - \brief Executes all the processes to run (in parallel if possible). - */ +/** @brief Executes all the processes to run (in parallel if possible). */ static inline void SIMIX_context_runall(void) { if (!xbt_dynar_is_empty(simix_global->process_to_run)) simix_global->context_factory->run_all(); } -/** - \brief returns the current running context - */ +/** @brief returns the current running context */ static inline smx_context_t SIMIX_context_self(void) { if (simix_global && simix_global->context_factory) diff --git a/src/simix/smx_process.cpp b/src/simix/smx_process.cpp index 82b4d162a4..530d7c9222 100644 --- a/src/simix/smx_process.cpp +++ b/src/simix/smx_process.cpp @@ -125,7 +125,7 @@ void SIMIX_process_empty_trash(void) while ((process = (smx_process_t) xbt_swag_extract(simix_global->process_to_destroy))) { XBT_DEBUG("Getting rid of %p",process); - SIMIX_context_free(process->context); + delete process->context; /* Free the exception allocated at creation time */ free(process->running_ctx); @@ -198,8 +198,7 @@ void SIMIX_process_stop(smx_process_t arg) { arg->auto_restart); } XBT_DEBUG("Process %s (%s) is dead",arg->name,sg_host_get_name(arg->host)); - /* stop the context */ - SIMIX_context_stop(arg->context); + arg->context->stop(); } /** @@ -925,7 +924,7 @@ void SIMIX_process_yield(smx_process_t self) XBT_DEBUG("Yield process '%s'", self->name); /* Go into sleep and return control to maestro */ - SIMIX_context_suspend(self->context); + self->context->suspend(); /* Ok, maestro returned control to us */ XBT_DEBUG("Control returned to me: '%s'", self->name); diff --git a/src/xbt/parmap.cpp b/src/xbt/parmap.cpp index 028ece10b6..95abdcea15 100644 --- a/src/xbt/parmap.cpp +++ b/src/xbt/parmap.cpp @@ -290,7 +290,7 @@ static void *xbt_parmap_worker_main(void *arg) XBT_DEBUG("Worker %d has finished", data->worker_id); /* We are destroying the parmap */ } else { - SIMIX_context_free(context); + delete context; xbt_free(data); return NULL; }