From: Gabriel Corona Date: Fri, 3 Jun 2016 11:00:48 +0000 (+0200) Subject: [simix] Pass the code by reference in simcall_run_kernel X-Git-Tag: v3_14~1056^2^2~5 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/97de6bf69a368f677e8324ec6d34106cf632d6dc?ds=sidebyside [simix] Pass the code by reference in simcall_run_kernel Avoid heap-allocating code for std::function. --- diff --git a/include/simgrid/simix.hpp b/include/simgrid/simix.hpp index 1f88d9730b..901081aa1b 100644 --- a/include/simgrid/simix.hpp +++ b/include/simgrid/simix.hpp @@ -24,6 +24,12 @@ XBT_PUBLIC(void) simcall_run_kernel(std::function const& code); +template inline +void simcall_run_kernel(F& f) +{ + simcall_run_kernel(std::function(std::ref(f))); +} + namespace simgrid { namespace simix {